buf.WriteString(typ.Obj().Name())
case *types.TypeParam:
- buf.WriteString(typ.Obj().Name())
+ // Type parameter names may change, so use a placeholder instead.
+ fmt.Fprintf(buf, "$%d", typ.Index())
default:
panic(fmt.Sprintf("unknown type %T", typ))
buf.WriteString(", ")
}
tp := tparams.At(i)
- buf.WriteString(tp.Obj().Name())
+ w.writeType(buf, tp)
if withConstraints {
buf.WriteByte(' ')
w.writeType(buf, tp.Constraint())
-pkg p4, func NewPair[T1 interface{ M }, T2 interface{ ~int }](T1, T2) Pair
-pkg p4, method (Pair[_, X2]) Second() X2
-pkg p4, method (Pair[X1, _]) First() X1
-pkg p4, type Pair[T1 interface{ M }, T2 interface{ ~int }] struct
+pkg p4, func NewPair[$0 interface{ M }, $1 interface{ ~int }]($0, $1) Pair
+pkg p4, method (Pair[$0, $1]) Second() $1
+pkg p4, method (Pair[$0, $1]) First() $0
+pkg p4, type Pair[$0 interface{ M }, $1 interface{ ~int }] struct
+pkg p4, func Clone[$0 interface{ ~[]$1 }, $1 interface{}]($0) $0