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

Aaron Crespo aaroncrespo at gmail.com
Wed Mar 22 20:16:27 CDT 2017


+1 What is "current private" can be replicated with the new behavior, use
of files, and use of modules.

On Wed, Mar 22, 2017 at 8:59 PM, Jordan Rose via swift-evolution <
swift-evolution at swift.org> wrote:

>
> 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
>
> _______________________________________________
> 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/20170322/9c812ff7/attachment.html>


More information about the swift-evolution mailing list