Re: [swift-users] Weird function call behaviour

2017-02-22 Thread David Hart via swift-users
> On 22 Feb 2017, at 22:02, Slava Pestov via swift-users > wrote: > > >> On Feb 22, 2017, at 1:01 PM, David Hart > > wrote: >> >> >>> On 22 Feb 2017, at 21:59, Slava Pestov via swift-users >>> mailto:swift-users@swift.org>> wrote: >>> >>> When a class conforms t

Re: [swift-users] Weird function call behaviour

2017-02-22 Thread Slava Pestov via swift-users
> On Feb 22, 2017, at 1:01 PM, David Hart wrote: > > >> On 22 Feb 2017, at 21:59, Slava Pestov via swift-users >> mailto:swift-users@swift.org>> wrote: >> >> When a class conforms to a protocol and a requirement is fulfilled by a >> method in an extension, the class does not get a vtable ent

Re: [swift-users] Weird function call behaviour

2017-02-22 Thread David Hart via swift-users
> On 22 Feb 2017, at 21:59, Slava Pestov via swift-users > wrote: > > When a class conforms to a protocol and a requirement is fulfilled by a > method in an extension, the class does not get a vtable entry for the > extension method. So it cannot be overridden in a subclass — there’s nothing

Re: [swift-users] Weird function call behaviour

2017-02-22 Thread Slava Pestov via swift-users
When a class conforms to a protocol and a requirement is fulfilled by a method in an extension, the class does not get a vtable entry for the extension method. So it cannot be overridden in a subclass — there’s nothing to dynamically dispatch here. We plan on addressing this as part of ABI stabi

[swift-users] Weird function call behaviour

2017-02-22 Thread David Hart via swift-users
In the following piece of code, can somebody explain the last result? Why the break in consistency? Is this a bug? protocol P { func foo() -> String } extension P { func foo() -> String { return "P" } } class A : P { func foo() -> String { return "A" } } class B : P {}