[swift-evolution] Type-based ‘private’ access within a file

Vladimir.S svabox at gmail.com
Thu Apr 6 13:43:17 CDT 2017

On 06.04.2017 21:17, Jordan Rose wrote:
>> On Apr 6, 2017, at 11:10, Vladimir.S <svabox at gmail.com> wrote:
>> On 06.04.2017 20:41, Jordan Rose via swift-evolution wrote:
>>> Hi, -evolution. I’ve said this before, but *I think this new
>>> proposal is a terrible idea*. It privileges types in a way that is
>>> damaging to the language.
>>> [There isn't really anything new in my discussion below; everyone
>>> on-thread is smart enough to have brought up these points already.
>>> But I wanted to go on record about it, at least.]
>> Thank you for sharing your opinion regarding this subject. Do I
>> understand correctly, that *you* propose to just revert access levels
>> and modifiers to Swift2 stage? (i.e. to drop current 'scoped-private'
>> and rename 'fileprivate'->'private') Or do you support to leave
>> current 'scoped-private' under another name?
> Neither, unfortunately. We accepted SE-0025, though I wish we hadn't; we
> named the two levels "private" and "fileprivate", though I wish we
> hadn't; and now there is lots of existing code relying on that, and it
> would be mean and capricious to force people to change that code when
> they migrated to Swift 4. I don't like where we ended up but Swift does
> not exist in a vacuum.

I see. Thank you for clarification.

I wonder, can't this be the situation that core team protects people 
"relying on that" when actually most(probably most, I don't know) people 
are asking "pleease.. rename this fileprivate to private back and keep 
'scoped' for those, who actually need Swift3 scoped-private, its the best 
solution, we are ready to change our code(actually just use 100% automatic 
rename) in Swift4"?
(Btw, probably one should prepare such 'official' proposal so community can 
provide response directly during its 'official' review?? I don't know. The 
situation is at least strange currently IMO: nobody likes current state, 
seems like we have the best solution for this, new official proposals looks 
like some workaround instead of right solution and IMO produces more 
confusion than even current state)

Waiting for your thoughts regarding submodules etc, as IMO keeping 
'fileprivate' keyword could be another one mistake we are making right now.

> Jordan

More information about the swift-evolution mailing list