[swift-evolution] [Proposal] Protected Access Level

Tino Heth 2th at gmx.de
Sun May 29 12:12:41 CDT 2016


I'm not opposed to the idea of finer-grained access levels in general, but if the current system is extended, the change imho should be more "holistic":
Right now, class hierarchy has no effect on accessibility, and it feels odd to have access level that is different from the others.
Doing so would rise questions like "why it is not possible to have a method that can be called from the current module, and from subclasses?".

There are several scenarios that can't be modeled in Swift now, and that still couldn't be modeled with a new "protected"-level (especially methods that can't be called from outside, but can be overridden by subclasses could be very useful).


More information about the swift-evolution mailing list