[swift-evolution] access control proposal
matthew at anandabits.com
Mon Dec 14 13:26:01 CST 2015
You are right. I misread your comment and thought you were referring to extensions in different files. For extensions in the same file substitute private for internal in my reply and it holds. We are not proposing to take away private.
Sent from my iPhone
> On Dec 14, 2015, at 12:40 PM, Marc Knaup <marc at knaup.koeln> wrote:
> This is not true. Extensions in the same file as the type they extend can see all members of that type. They don't have to be internal.
>> On Dec 14, 2015 7:29 PM, "Matthew Johnson" <matthew at anandabits.com> wrote:
>>> Well that would break the pattern where you split the implementation of a type across several extensions in the same file.
>>> This is also often done when declaring protocol conformance to break down the type into logical pieces.
>>> I don't want to be forced to squeeze everything into the same body and declare a list of a dozen protocol conformance at once.
>> No, it doesn't break that pattern at all. In that case you already need to declare members visible to all extensions internal. Nothing in this proposal will prevent you from doing that. We are discussing use cases where a *single* extension, etc has implementation details it wants to keep hidden from *everything* outside that single extension.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution