[swift-evolution] [swift-evolution-announce] [Review] SE-0159: Fix Private Access Levels

Jordan Rose jordan_rose at apple.com
Wed Mar 22 19:59:58 CDT 2017


> On Mar 21, 2017, at 15:26, Xiaodi Wu via swift-evolution <swift-evolution at swift.org> wrote:
> 
> The kicker is, _it also doesn't work_. Try, for instance:
> 
> ```
> struct Foo {
>   private var bar: Int { return 42 }
> }
> 
> extension Foo {
>   private var bar: Int { return 43 }
> }
> ```
> 
> The code above should compile and does not. If I understood correctly the explanation from a core team member on this list, it's unclear if it can be made to work without changing how mangling works, which I believe impacts ABI and is not trivial at all. Thus, (a) even proponents of new `private` disagree on one of two key goals stated for new `private`; (b) that goal was never accomplished, and making it work is not trivial; (c) no one even complained about it, suggesting that it was a low-yield goal in the first place.

Without commenting on anything else, it is considered a bug that this does not work under SE-0025, and it has been complained about <https://bugs.swift.org/browse/SR-2634> (though not vigorously, since the workaround is trivial), and fixing it would not be an ABI-breaking change (because private functions are not part of a module's ABI).

Jordan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170322/287a1e89/attachment.html>


More information about the swift-evolution mailing list