[swift-evolution] [Proposal] Revising access modifiers on extensions

Jordan Rose jordan_rose at apple.com
Mon Jun 27 17:06:42 CDT 2016


> On Jun 27, 2016, at 13:00, Adrian Zubarev via swift-evolution <swift-evolution at swift.org> wrote:
> 
> I still have no idea why you want to make this change, other than “putting an access modifier on an extension is different from putting an access modifier on a type”. Are you trying to hide protocol conformances that would be otherwise public? 
> In my proposal I cannot hide a public protocol conformance. Its not possible with normal types and it shouldn’t be possible with extensions as well. (Correct me if I’m wrong.) I really want the same access control behavior with extensions like whit classes, enums and structs. For new Swift developers such consistency would be great, because they won’t need to learn another access control behavior (second one goes to protocols). 
> 

If you want consistent behavior, the proposal should just be "remove access modifiers from extensions". That way, access for members follows the same defaults as in the original type. The only purpose for access modifiers on extensions is to change the default, so if you don't like the behavior of changing the default, then the feature should be removed.

Jordan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160627/89783e43/attachment.html>


More information about the swift-evolution mailing list