Please what is wrong with is code?
func check<T,U>(_ this: T, with: U) where U.Type == T.Type { ... }
Finally why must a protocol with associated type have at least one parameter of type "Self"?
Jens
2
The diagnostics that your version results in is not very helpful, but if you meant that T should be equivalent to U, that is:
func check<T,U>(_ this: T, with: U) where U == T { } // ERROR:
// Same-type requirement makes generic parameters 'T' and 'U' equivalent
Then the error message makes it clear that you probably meant:
func check<T>(_ this: T, with: T) { }
which compiles.
1 Like
This better be filed to improve the diagnostic SR-8239