[swift-evolution] [swift-evolution-announce] [Review] SE-0117: Default classes to be non-subclassable publicly

Tino Heth 2th at gmx.de
Mon Jul 11 02:50:56 CDT 2016


> In the implementation of the subclass, there has to be a call to one of the superclass's initializers. If all of the superclass’s initializers are non-public, then there’s no way to write your own initializer. (This is actually true in Swift today.)
I want to point out that this strange behavior can actually be useful:
As of now, you cannot create a public subclass with internal ancestors — it's all or nothing.
When you keep the initializer of the base class internal, you practically seal this class, but it's still possible for framework clients to access the public subclasses supplied for them.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160711/39594b7b/attachment.html>


More information about the swift-evolution mailing list