[swift-evolution] [Proposal] Revising access modifiers on extensions
Adrian Zubarev
adrian.zubarev at devandartist.com
Mon Jun 27 17:22:42 CDT 2016
I apologize for all the typos I make, I’m way too tired and it’s already late night for me. (I just feel like I need to apologize :] )
I meant:
Anything else I may need to change to drive my proposal into that direction?
--
Adrian Zubarev
Sent with Airmail
Am 28. Juni 2016 um 00:17:35, Adrian Zubarev (adrian.zubarev at devandartist.com) schrieb:
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.
I’m a little confused right now, because to me “remove access modifiers from extensions” sounds like there will be no access modifier at all.
And yes I indeed don’t like that behavior, because it has a lot potential of confusion. Don’t get me wrong, now I do understand how it works, but the way it behaves is strange.
If we’d remove this feature, would extensions automatically work like I described in the proposal?
internal protocol A {
func foo()
}
public struct B {}
// A is hidden
public extension B : A {
// `foo` can be made visible
public func foo() {}
}
// extension will be imported as
public extension B {
public func foo()
}
Anything else I made need to change to drive my proposal into that direction?
I really appreciate your feedback. :)
--
Adrian Zubarev
Sent with Airmail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160628/e3f28b75/attachment.html>
More information about the swift-evolution
mailing list