T[A] and T[B] are different types, but we were writing them both as
just "T". Reported by Russ.
Change-Id: I27db35946b6d3a1fad6c56c785fa6d850ad71d00
Reviewed-on: https://go-review.googlesource.com/c/go/+/558716
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
buf.WriteByte('.')
}
buf.WriteString(typ.Obj().Name())
+ if targs := typ.TypeArgs(); targs.Len() > 0 {
+ buf.WriteByte('[')
+ for i := 0; i < targs.Len(); i++ {
+ if i > 0 {
+ buf.WriteString(", ")
+ }
+ w.writeType(buf, targs.At(i))
+ }
+ buf.WriteByte(']')
+ }
case *types.TypeParam:
// Type parameter names may change, so use a placeholder instead.
-pkg p4, func NewPair[$0 interface{ M }, $1 interface{ ~int }]($0, $1) Pair
+pkg p4, func NewPair[$0 interface{ M }, $1 interface{ ~int }]($0, $1) Pair[$0, $1]
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