mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +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
13 lines
170 B
Swift
13 lines
170 B
Swift
// RUN: not %target-swift-frontend -typecheck %s
|
|
|
|
|
|
protocol A {
|
|
associatedtype B
|
|
}
|
|
|
|
extension A {
|
|
func foo() {
|
|
(B.self as! Sequence.Type).Element
|
|
}
|
|
}
|