mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
19 lines
612 B
Swift
19 lines
612 B
Swift
// RUN: %target-typecheck-verify-swift -enable-library-evolution
|
|
|
|
public struct Wrapper<T: P>: P { }
|
|
extension Wrapper: Q where T: Q { }
|
|
|
|
public protocol PBase {
|
|
associatedtype AssocType
|
|
}
|
|
|
|
public protocol P: PBase {
|
|
override associatedtype AssocType: P = Wrapper<Self>
|
|
// expected-note@-1{{associated type 'AssocType' has default type 'Wrapper<Self>' written here}}
|
|
}
|
|
|
|
public protocol Q: P where Self.AssocType: Q { }
|
|
|
|
public protocol R: Q where Self.AssocType: R { }
|
|
// expected-warning@-1{{default type 'Wrapper<Self>' for associated type 'AssocType' does not satisfy constraint 'Self.AssocType': 'R'}}
|