mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
21 lines
360 B
Swift
21 lines
360 B
Swift
// RUN: not %target-swift-frontend -typecheck %s
|
|
|
|
// Was crashing in associated type inference.
|
|
|
|
protocol P {
|
|
associatedtype Assoc
|
|
|
|
subscript(i: Int) -> Assoc { get }
|
|
func f() -> Assoc
|
|
}
|
|
|
|
struct X<T, U> { }
|
|
|
|
extension P {
|
|
subscript<T>(i: T) -> X<T, Self> { return X<T, Self>() }
|
|
func f<T>() -> X<T, Self> { return X<T, Self> }
|
|
}
|
|
|
|
struct Y<T>: P { }
|
|
|