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

Haravikk swift-evolution at haravikk.me
Sun Mar 27 16:31:37 CDT 2016

> On 27 Mar 2016, at 19:34, Jose Cheyo Jimenez via swift-evolution <swift-evolution at swift.org> wrote:
> Public 
> External (default)
> Internal
> Private

I still feel like these are still too vague; I’m not sure I like the use of external, as public to me is external since it exports outside of the module, whereas what you’re proposing is in fact just limited to the module itself. I dislike the current internal keyword too, but at least it reads as “internal to this module", this is why the more specific terms are better like:

	public				as-is, item is public/exported outside of module
	private(module) or private	current internal, item is private to this module, would be the default
	private(file)			current private, item is private to this file
	private(scope)			new visibility type, item is private to the current scope

Assuming I’m understanding the restriction properly this time =)

It’s also the easiest method if we do add another visibility later for sub-classes such as private(type), as it doesn’t even require a new keyword.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160327/176147c6/attachment.html>

More information about the swift-evolution mailing list