mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
15 lines
259 B
Swift
15 lines
259 B
Swift
// RUN: not %target-swift-frontend -typecheck %s
|
|
|
|
struct S<N> {}
|
|
|
|
protocol P {
|
|
associatedtype A: P = Self
|
|
static func f(_ x: A) -> A
|
|
}
|
|
|
|
extension S: P where N: P {
|
|
static func f<X: P>(_ x: X) -> S<X.A> where A == X, X.A == N {
|
|
return S<X.A>()
|
|
}
|
|
}
|