I may be missing something, but it seems to me that one point in the draft's discussion of type inference could usefully be clarified (
https://go.googlesource.com/proposal/+/refs/heads/master/design/go2draft-type-parameters.md#type-inference).
The term "type parameter" there should be restricted to the type parameters in the specific use of a generic type or function for which we are trying to infer type arguments. For example (
https://go2goplay.golang.org/p/pWis3rlJElu)
func Min[type T interface{ type int, uint }](a, b T) T {
if b < a {
return b
}
return a
}
func Min3[type U interface{ type int }](a, b, c U) U {
return Min(a, Min(b, c))
}
func BadMin3[type V interface{ type int, uint, string }](a, b, c V) V {
return Min(a, Min(b, c))
}
Here, U and V are type parameters, but when inferring type arguments for the calls to Min, we must consider U and V as fixed types, not subject to type unification. This seems needed in order for the compiler to reject BadMin3.