Thanks to both of you for the follow-up.
For my use, the class being final is probably ok.
Dave Reed
> On Jan 10, 2017, at 3:05 AM, Slava Pestov wrote:
>
>>
>> On Jan 9, 2017, at 11:59 PM, Pierre Monod-Broca via swift-users
>> wrote:
>>
>> Hi
> On Jan 9, 2017, at 11:59 PM, Pierre Monod-Broca via swift-users
> wrote:
>
> Hi again,
>
> You might want to look at Self requirement in protocols for exemple:
> protocol P {
> func items(/*...*/) -> [Self]
> }
> class C: P {
> func items(/*...*/) -> [C] {
>...
Hi again,
You might want to look at Self requirement in protocols for exemple:
protocol P {
func items(/*...*/) -> [Self]
}
class C: P {
func items(/*...*/) -> [C] {
...
}
}
However it might not always work as you expect.
I can't say which is the better. Using associated type might be
Hello,
It looks that you have what you wanted because Event.Entity is an alias of
Event.
Pierre
> Le 5 janv. 2017 à 16:47, Dave Reed via swift-users a
> écrit :
>
> Is there a way to make a static or class method specify the return type be
> the actual class it is