[swift-evolution] Type-based ‘private’ access within a file

Brent Royal-Gordon brent at architechies.com
Mon Apr 3 19:01:19 CDT 2017

> On Apr 3, 2017, at 3:51 PM, Vladimir.S <svabox at gmail.com> wrote:
>>> Moreover, I think that we need *additional* access level(to current
>>> 'private'), which will mean 'can be accessed from extensions and subtypes
>>> in the same *module*' to be able to split type's conformances to number
>>> of files and don't make implementation details accessible&visible for
>>> whole module. (there was 'extensible' modifier discussed previously).
>> If we wanted to do this, I think we'd want a `protected` modifier that was
>> orthogonal to `internal` and `private` (which would probably revert to
>> `fileprivate` semantics):
> I don't think so, IMO it seems like over-complicated structure of access levels.

And having:

1. open
2. public
3. internal
4. Whatever your new "internal but type-only" access level would be called
5. fileprivate
6. private
Is *not* overcomplicated? At that point, it's much simpler to think of it as four access levels + type-only or all-types.

Again, I'm not saying such a design is *good*. I'm saying it's *better than six access levels*.

Brent Royal-Gordon

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

More information about the swift-evolution mailing list