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

Jonathan Hull jhull at gbis.com
Mon Mar 14 23:39:33 CDT 2016


On Mar 14, 2016, at 8:36 PM, Patrick Pijnappel via swift-evolution <swift-evolution at swift.org <https://lists.swift.org/mailman/listinfo/swift-evolution>> wrote:
> The only question is (as Sean mentioned) how this combines with the syntax
> for setter access level, e.g. the current private(set). Options:
> - Unnamed 2nd argument, giving private(file), private(file, set),
> private(set).
> - Named 2nd argument, giving e.g. private(file), private(file, accessor:
> set), private(accessor: set). Less ambiguity but longer.
> - Not using multiple arguments, but that'd probably break consistency with
> the other unification efforts going on to make everything look like
> function calls.
What about the following 3 forms?

private(file) //both setter and getter have file scope
private(set: file) //setter has file scope.  Equivalent to current “private(set)"
private(get: module, set: file) //getter has module scope & setter has file scope

It is a bit weird, but we should probably also allow “public" in that last form: private(get: public, set: module)

Thanks,
Jon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160314/af32ff03/attachment-0001.html>


More information about the swift-evolution mailing list