[swift-evolution] SE-0025: Scoped Access Level, next steps

James Froggatt conductator at ntlworld.com
Tue Mar 15 10:52:28 CDT 2016


Accessible within subclass implementations, or from within types to which an extension applies.

From James F

> On 15 Mar 2016, at 14:17, Ondrej Barina <obarina at gmail.com> wrote:
> 
> What would be the meaning of:
> 1/ scoped public
> 2/ scoped internal
> ?
> O.
> 
> On Tue, Mar 15, 2016 at 2:59 PM, James Froggatt via swift-evolution
> <swift-evolution at swift.org> wrote:
>> I didn't get any responses to my previous email (sorry if I came across as impatient), but I would like to reiterate my suggestion of a ‘scoped’ keyword, since it seems like it would solve many of the issues people have with other solutions:
>> 
>> private var foo
>> scoped private var foo
>> 
>> internal var foo
>> scoped internal var foo
>> 
>> public var foo
>> scoped public var foo
>> 
>> This can then be used with all existing access levels, with no breaking changes.
>> Am I missing a use case, or would this be suitable?
>> 
>> 
>> 
>> alternatives:
>> 
>> file private var foo //breaking change
>> 
>> private(scoped) var foo //conflicts with private(set)
>> 
>> private(file) var foo //same conflict
>> 
>> 
>> 
>> From James F
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-evolution



More information about the swift-evolution mailing list