Avatar
Avatar
koher
@swift-main protocol P { func foo() -> Int } struct S: P { func foo() -> Int { 42 } } func useP<T: P>(_ p: T) -> (T, T) { (p, p) } let p: any P = S() let q = useP(p) print(type(of: q)) print(q)
swiftNightly BOT 6/3/2022 2:29 AM
(P, P) (main.S(), main.S())