[swift-evolution] [Discussion] fileprivate vs. private(file)

Brent Royal-Gordon brent at architechies.com
Mon Feb 20 07:30:39 CST 2017

> On Feb 20, 2017, at 3:42 AM, Haravikk via swift-evolution <swift-evolution at swift.org> wrote:
> The proposal I preferred was to use only the public and private keywords and use parameters to provide greater specificity, like so:
> 	public			as it is now
> 	private(module)	equivalent to internal, which is private to the current module/project
> 	private(file)		equivalent to fileprivate
> 	private(scope)		equivalent to current private

We considered this last year and decided it was a bad idea. The `private` keyword ends up just being surplusage—it just adds noise without adding meaning.

I think you may be forgetting that we're now under source stability constraints. It's one thing to drop ill-advised features or rename keywords to make space for new features; it's something else to rename things all across the language for the sake of renaming them.

Brent Royal-Gordon

More information about the swift-evolution mailing list