[swift-evolution] access control proposal
ilya.belenkiy at gmail.com
Mon Dec 14 12:49:50 CST 2015
Yes. The proposal is about providing a more limited access that hides
implementation details for an API. So anything that uses the API whether it
is in the same file or not cannot see (and potentially misuse) the
implementation of the API.
On Mon, Dec 14, 2015 at 1: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