mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
29 lines
382 B
Swift
29 lines
382 B
Swift
// RUN: %target-typecheck-verify-swift -disable-availability-checking
|
|
|
|
protocol P<T> {
|
|
associatedtype T
|
|
func foo() -> any P<T>
|
|
}
|
|
|
|
struct A: P {
|
|
typealias T = Int
|
|
func foo() -> any P<T> {
|
|
self
|
|
}
|
|
}
|
|
|
|
struct B: P {
|
|
typealias T = Int
|
|
func foo() -> any P<T> {
|
|
self
|
|
}
|
|
}
|
|
|
|
struct G<T> {
|
|
let t: T
|
|
}
|
|
|
|
let p: any P = A()
|
|
let g = G(t: p.foo())
|
|
let gg: G<any P> = g
|