Open
Description
The compiler emits a warning on a same-type constraint between generic parameter types:
// warning: same-type requirement makes generic parameters 'U' and 'T' equivalent; this is an error in Swift 6
func foo1<T, U>(_: T, _: U) where U == T {}
I believe a similar warning is then warranted if a generic parameter is equated to a nested type parameter:
protocol P {
associatedtype A
}
func foo2<T: P, U>(_: T, _: U) where U == T.A {}
Possible warning: same-type requirement makes generic parameter 'U' redundant; this is an error in Swift 6