[swift-evolution] Simplifying Access Using 'Hidden'

Joanna Carter joanna at carterconsulting.org.uk
Wed Feb 15 15:53:27 CST 2017


> This definition of `scoped` is actually much different than the current `private` which restricts visibility to the *current* scope.  Your definition allows visibility in an unlimited number of scopes that just happen to be of the same type.  I don’t think `scoped` is a good name for this.

Agreed

> `private(type)` would be a better name if we were going to make this a modification of the existing access modifiers.  However, I don’t think this is the right direction.  If we’re going to have an access modifier that means “in the same file *and* the same type” I think that should simply be called `private` (a “soft default”).  If we’re going to have something between `internal` and `fileprivate` I think it would be better to explore submodules than introduce something like `internal(type)`.

I remember discussions earlier in Swift's history about bracketed keywords and it is my opinion that, when you consider other such syntax, such as public private(set) var … , this could, all too soon, get very confusing.

--
Joanna Carter
Carter Consulting



More information about the swift-evolution mailing list