mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
A protocol extension of a private protocol can define internal or public members. We should not be able to find these members from another file or module if an internal or public type conforms to the protocol. Fixes <rdar://problem/21380336>.
14 lines
332 B
Swift
14 lines
332 B
Swift
public protocol PublicProtocol {
|
|
func publicRequirement()
|
|
}
|
|
|
|
private protocol PrivateProtocol : PublicProtocol {}
|
|
|
|
public struct Conformer : PrivateProtocol {}
|
|
|
|
extension PrivateProtocol {
|
|
// This implementation is opaque to callers, since we can
|
|
// only find it via a private protocol.
|
|
public func publicRequirement() {}
|
|
}
|