[swift-evolution] Abstract methods

Trevör Anne Denise trevor.annedenise.developer at gmail.com
Mon Nov 6 13:35:44 CST 2017


> to me protocol extensions are both cool and evil. cool as you can add code.
> evil because it's more natural to add another declarations in those
> extensions rather than implementation:
> 
> protocol Foo {
>    func foo()
> }
> 
> extension Foo {
>   func bar()    //*** natural assumption is that i can do this. but i can't
> }

While this can indeed be a common mistake, it feels much less natural to do that once you think about what protocol conformances mean and what it would take to make it possible IMO.


More information about the swift-evolution mailing list