[swift-evolution] Enhancing access levels without breaking changes

Tino Heth 2th at gmx.de
Mon Apr 10 10:14:09 CDT 2017


> The one issue I see is sticking that public extension inside a private one.  I think you would have to mark ‘secret: Int’ as private instead of the extension itself to allow the effect you are looking for…
I didn't think that much while writing the example, but this one was actually on purpose:
It's stated in the Swift documentation that the default visibility of members in an extension equals the level of the extension — so this use of extensions is also a way to group all public declarations (the other levels as well), and save some keystrokes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170410/9840da53/attachment.html>


More information about the swift-evolution mailing list