mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Since member lookup doesn't check requirements it might sometimes return types which are not visible in the current context e.g. typealias defined in constrained extension, substitution of which might produce error type for base, so assignement should thead lightly and just fail if it encounters such types. Resolves: rdar://problem/39931339 Resolves: SR-5013
40 lines
504 B
Swift
40 lines
504 B
Swift
// RUN: %target-typecheck-verify-swift
|
|
|
|
protocol P0 {
|
|
associatedtype A
|
|
}
|
|
|
|
protocol P1 {
|
|
associatedtype B : P3 = S0<S2>
|
|
associatedtype C = ()
|
|
}
|
|
|
|
protocol P2 {
|
|
associatedtype D : P1
|
|
associatedtype E : P3 = S0<S2>
|
|
}
|
|
|
|
protocol P3 : P0 where A : P2 {}
|
|
|
|
struct S0<T> : P0 {
|
|
typealias A = T
|
|
}
|
|
|
|
extension S0 : P3 where T : P2 {}
|
|
|
|
struct S2 : P2 {
|
|
struct D : P1 {
|
|
let value: S2
|
|
}
|
|
}
|
|
|
|
extension P1 where C : P2 {
|
|
typealias B = C.E
|
|
}
|
|
|
|
extension P3 {
|
|
func foo() {
|
|
_ = A.D.B.self
|
|
}
|
|
}
|