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

Kevin Nattinger swift at nattinger.net
Thu Apr 6 18:52:57 CDT 2017


> On Apr 6, 2017, at 6:10 PM, Douglas Gregor via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Hello Swift community,
> 
> The review of SE-0169 "Improve Interaction Between private Declarations and Extensions" begins now and runs through April 11, 2017. The proposal is available here:
> 
> https://github.com/apple/swift-evolution/blob/master/proposals/0169-improve-interaction-between-private-declarations-and-extensions.md <https://github.com/apple/swift-evolution/blob/master/proposals/0169-improve-interaction-between-private-declarations-and-extensions.md>
> ...
> 
> What is your evaluation of the proposal?
Strong +1. This would eliminate most of the need to unnecessarily expose private state to scopes where it doesn’t belong.

> Is the problem being addressed significant enough to warrant a change to Swift?
Very much so. I was surprised and disappointed to find out that private didn’t work this way already when 3 came out.

> Does this proposal fit well with the feel and direction of Swift?
Yes, it’s an important and necessary step.
Swift encourages splitting class implementations into a number of extensions for logical grouping, protocol conformance, etc. Currently, implementing classes this way often requires bumping private members to fileprivate, thereby dangerously exposing them to any other classes in the file.

> If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
Most languages don’t have this problem because the primary implementation isn’t normally broken into pieces in the same way.  I’d argue that the set of declaration + extensions that make up the primary body of the class are together equivalent to a single-body declaration in other languages, and therefore privates should be available to all pieces thereof.
> How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
Followed the several discussions about file/private access over the last year or two, and contributed to the current one.

> More information about the Swift evolution process is available at
> 
> https://github.com/apple/swift-evolution/blob/master/process.md <https://github.com/apple/swift-evolution/blob/master/process.md>
> Thank you,
> 
> -Doug
> 
> Review Manager
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170406/69720892/attachment.html>


More information about the swift-evolution mailing list