mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-09 21:43:40 +00:00
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:
Vendored
+2
@@ -47,3 +47,5 @@ issue4931PairA labels: 0
|
||||
issue4931PairB labels: 0
|
||||
issue4931MethodA labels: 0
|
||||
issue4931MethodB labels: 0
|
||||
ok: aliasSize[float32]==32
|
||||
ok: aliasSize[float64]==64
|
||||
|
||||
Reference in New Issue
Block a user