mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Validation for typealiases in protocols is... odd. It needs to avoid depending on the whole protocol being validated, so it does an initial validation that can leave nested types of Self (and other associated types) somewhat unresolved. In these cases, do something icky but partially effective: when we resolve the protocol, go back and clean up the types of these typealiases. A better solution would allow us to use the types of these typealiases within the Generic Signature Builder without recording them in the AST as "the interface type", so there's no way unresolved nested types could be found (and, therefore, nothing to "fix up" later). Howwever, that's a more significant undertaking. Fixes rdar://problem/32287795.
15 lines
202 B
Swift
15 lines
202 B
Swift
// RUN: %target-swift-frontend %s -emit-ir
|
|
struct X<T: Q> {
|
|
func f(_: T.Z) { }
|
|
}
|
|
|
|
protocol P {
|
|
associatedtype A
|
|
associatedtype B
|
|
}
|
|
|
|
protocol Q {
|
|
associatedtype C: P
|
|
typealias Z = (C.A, C.B)
|
|
}
|