Avatar
Avatar
Iceman
@swift-main protocol P { associatedtype A } func f<T: P, U>(t: T.Type, u: U.Type) where T.A == U { } struct S: P { typealias A = (foo: Int, bar: Int) } f(t: S.self, u: (foo: Int, bar: Int).self) f(t: S.self, u: (Int, Int).self)
swiftNightly BOT 4/10/2024 7:54 AM
exit status: 1 with <stdin>:13:1: error: global function 'f(t:u:)' requires the types '(Int, Int)' and 'S.A' (aka '(foo: Int, bar: Int)') be equivalent 3 | } 4 | 5 | func f<T: P, U>(t: T.Type, u: U.Type) where T.A == U { | `- note: where 'U' = '(Int, Int)', 'T.A' = 'S.A' (aka '(foo: Int, bar: Int)') 6 | } 7 | : 11 | 12 | f(t: S.self, u: (foo: Int, bar: Int).self) 13 | f(t: S.self, u: (Int, Int).self) | `- error: global function 'f(t:u:)' requires the types '(Int, Int)' and 'S.A' (aka '(foo: Int, bar: Int)') be equivalent 14 |