> 
> On Oct 7, 2016, at 5:46 PM, Trans via swift-evolution 
> <[email protected]> wrote:
> 
> Private access that limits exposure to extensions and subclasses is
> the bane of reusability. It sucks in Java and it sucks in Swift. As
> far as I know Ruby is the only language that seems to get that.

Agreed.  Reading this thread, almost everyone’s presented actual use cases 
would be fixed if we could do something functionally equivalent to 
private(type) (even if that’s not the best syntax).  If we could have the 
ability to write extensions for a type throughout a module and access its 
private properties (and private subtypes, methods, etc.), then the ugliness 
introduced by fileprivate would be all but eliminated.  That’s an access level 
I would love.

I do want to mention, though, that while I would enjoy C++-style type-level 
private, I don’t want protected.  The rationale for avoiding that in Swift is 
fantastic.

> _______________________________________________
> swift-evolution mailing list
> [email protected]
> https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to