Files
swift-mirror/validation-test/compiler_crashers_2_fixed/0159-rdar39931339.swift
Pavel Yaskevich 11ba7e0f42 [CSSimplify] When trying to simplify bind with error type fail gracefully
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
2018-05-28 00:24:54 -07:00

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
}
}