[swift-evolution] [Draft] open and public protocols

Adrian Zubarev adrian.zubarev at devandartist.com
Sun Feb 19 10:28:11 CST 2017


I really feel I’m blind, I cannot find it. Is the access modifier of open protocol *members* on open/public classes public by default, or open?

If open, can we downgrade it to public in an open class?


-- 
Adrian Zubarev
Sent with Airmail

Am 19. Februar 2017 um 17:16:59, Matthew Johnson (matthew at anandabits.com) schrieb:



Sent from my iPhone

On Feb 19, 2017, at 10:11 AM, Adrian Zubarev <adrian.zubarev at devandartist.com> wrote:

@Matthew: Have you considered what happens with the access modifier of an open protocol when an open/public class conforms to it?


Yes I covered this in the detailed design section of the proposal.
// Module A
open protocol A {
    func foo()
}

// Module B
open class B : A {
    (open or public) func foo() {}
    // If `open`, can we downgrade to `public`?
    // The other way around seems straightforward   
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170219/22f41adb/attachment.html>


More information about the swift-evolution mailing list