compiler: canonicalize generic instance identities

x/tools SSA names and go/types strings can preserve the source spelling of
type arguments, so aliases can make distinct instances collide. Use the
canonical type encoding for function names, synthetic local type owners,
instantiated named types, and method sets.
This commit is contained in:
Jake Bailey
2026-07-12 14:12:54 -07:00
committed by Ron Evans
parent 73db9776b1
commit c7923d1c64
5 changed files with 51 additions and 46 deletions
+4 -4
View File
@@ -48,13 +48,13 @@ issue4931PairB labels: 0
issue4931MethodA labels: 0
issue4931MethodB labels: 0
ok: aliasSize[float32]==32
BUG: aliasSize[float64]==64
ok: aliasSize[float64]==64
ok: aliasLocal[float32] accepts own
ok: aliasLocal[float64] accepts own
BUG: aliasLocal[float32] rejects [float64]
BUG: aliasLocal[float64] rejects [float32]
ok: aliasLocal[float32] rejects [float64]
ok: aliasLocal[float64] rejects [float32]
ok: aliasBox[float32] implements Get() float32
BUG: aliasBox[float64] implements Get() float64
ok: aliasBox[float64] implements Get() float64
ok: aliasMethod[float32] accepts own
ok: aliasMethod[float64] accepts own
BUG: aliasMethod[float32] rejects [float64]