compiler: disambiguate generic instances with function-local type aliases

x/tools go/ssa names instantiations using the type argument's String().
Function-local aliases like `type F = float64` therefore collide when two
callers use distinct aliases named F (Go 1.27's internal/strconv.ftoa32
and ftoa64 do exactly this). Extend localTypeArgsSuffix to detect local
aliases and include their declaration position, so the float32 and
float64 instantiations get distinct LLVM symbols.

Fixes wrong float formatting in strconv/math on Go 1.27, and adds a
regression test to testdata/localtypes.go.

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram
2026-07-11 18:28:03 +02:00
parent 35a61ac8c5
commit 6645f412ae
3 changed files with 50 additions and 1 deletions
+2
View File
@@ -47,3 +47,5 @@ issue4931PairA labels: 0
issue4931PairB labels: 0
issue4931MethodA labels: 0
issue4931MethodB labels: 0
ok: aliasSize[float32]==32
ok: aliasSize[float64]==64