[swift-users] Comparing POP to OOP
Dmitri Gribenko
gribozavr at gmail.com
Tue Feb 16 20:49:18 CST 2016
On Tue, Feb 16, 2016 at 6:28 PM, Jon Hoffman via swift-users
<swift-users at swift.org> wrote:
> You are correct that if you are using the protocol type to interact with the
> instance then the method defined in the protocol extension will be called
> however if it is type casted to a concrete type which has a method that
> overrides the method in the protocol extension then the method in the
> concrete type would be called.
The method in the concrete type does not override the method from the
protocol extension, it merely shadows that method.
Dmitri
--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
More information about the swift-users
mailing list