Avatar
Avatar
Iceman
@swift-main @swift-5.8.1 protocol P {} protocol Q<T> { associatedtype T } typealias PQ<T> = P & Q<T> func f() { let foo: any Q<Int> let bar: any P & Q<Int> let baz: any (P & Q<Int>) let qux: any PQ<Int> } (edited)
exit status: 1 with <stdin>:8:22: error: non-protocol, non-class type 'Q<Int>' cannot be used within a protocol-constrained type let bar: any P & Q<Int> ^ <stdin>:9:23: error: non-protocol, non-class type 'Q<Int>' cannot be used within a protocol-constrained type let baz: any (P & Q<Int>) ^ (edited)