[swift-evolution] [Review] SE-0026 Abstract classes and methods

Thorsten Seitz tseitz42 at icloud.com
Fri Mar 4 00:03:49 CST 2016


> Am 03.03.2016 um 23:16 schrieb Brent Royal-Gordon via swift-evolution <swift-evolution at swift.org>:
> 
> Protocols don't operate entirely within the class hierarchy, but Swift's type system is broader than just a class hierarchy. In the context of the entire type (directed acyclic) graph, they play the same role of enforcing requirements on subtypes. And with the proper features in place, that's all we really need.

If you argue that the type graph should governed by protocols only, then we should think about whether it makes sense to take classes (and structs, enums) out of that completely, i.e. these do not define types and classes just provide implementation inheritance. Protocols could then even have their own namespace solving some naming issues. But I'm note sure whether that's really desirable. If not then IMO classes should have comparable capabilities to protocols with regards to shaping the type graph and not be second class citizens.

-Thorsten 


More information about the swift-evolution mailing list