[swift-evolution] Swift evolution proposal: introduce typeprivate access control level

Jean-Daniel dev at xenonium.com
Sun Dec 4 03:03:25 CST 2016


> Le 1 déc. 2016 à 18:54, Gonçalo Alvarez Peixoto via swift-evolution <swift-evolution at swift.org> a écrit :
> 
> @Aron, I did take a look at that document while developing the proposal. As you stated, it's a little old, however the principles of access control and their purpose remain pretty much the same. 
> 
> ".keep private details of a class hidden from the rest of the app
>  .keep interna details of a framework hidden from the client app"
> 
> Both these rules still get respected with the introduction of a new level of access control. typeprivate would not allow for member access within any other then the type itself.

typeprivate is confusing. Would we allow access to extension in the same file, in the same module, everywhere ? 

If a ‘typeprivate’ is accessible anywhere, it look more like a public var than a private one.

Maybe we should also introduce a typeinternal and typepublic modifier in such case to explicitly define who can access the var.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20161204/099fd957/attachment.html>


More information about the swift-evolution mailing list