[swift-evolution] final + lazy + fileprivate modifiers

Joanna Carter joanna at carterconsulting.org.uk
Mon Feb 20 12:10:15 CST 2017

Joanna Carter
Carter Consulting

Envoyé de mon iPad

> Le 20 févr. 2017 à 18:40, Vladimir.S <svabox at gmail.com> a écrit :
>> On 20.02.2017 20:04, Joanna Carter wrote:
>> I'm not sure why ; with 'extensible' available to code within the same
>> file, why would you still need fileprivate anywy?
> To provide access for internals of my type for code in current file only,
> and don't for any extension/subtype in other files. I.e. 'friend' classes in the same file, but don't want to provide any details out of the file.

Ah, I can see what you're getting at there. How about the idea of using nested types?

> I assume the 'extensible' modifier should be limited by current module only.
> I.e. in my understanding 'extensible' : "in current file and in subtypes/extensions in other files inside the module". I believe there is a consensus that Swift should not export "private" API out of the module.

My thinking about extensible is that it is not for truly private stuff ; more for extending the same idea of protected access for classes to the more Swiftier concept of extensions.

Joanna Carter
Carter Consulting

More information about the swift-evolution mailing list