[swift-evolution] [swift-evolution-announce] [Review] SE-0169: Improve Interaction Between private Declarations and Extensions

Tino Heth 2th at gmx.de
Thu Apr 13 02:15:52 CDT 2017


> No change
> Benefit: No change to the language.
> Drawback: Must use “fileprivate” to build up a type through extensions.
> 
> SE–0159
> Benefit: Simplifies the access control model.
> Drawback: Cannot protect invariants within a file.
> 
> SE–0169
> Benefit: Cross-type sharing is clearly marked.
> Drawback: Must use a helper type to protect invariants within a file.
> 
> Rename
> Benefit: No change to semantics.
> Drawback: Two separate keywords are changed.


As the dedicated thread was highjacked ;-), imho it's just fair to add another option here...

Nested extensions
Benefit: Expressive power, no breaking change (and more…)
Drawback: More indentation

The table is quite boring:
Nested Extensions
Simple file	private
Extensions	private
Sharing	private
Helper visible	private
Helper hidden	private
Invariants	private
Multi-type	private
Multi-type + ext	private

I'm not sure about the colour, but if I wasn't to lazy to edit raw HTML, imho there would a lot of green ;-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170413/2ff64e21/attachment.html>


More information about the swift-evolution mailing list