From cefd445939396fb3492b8d165d71f6014a70ae7d Mon Sep 17 00:00:00 2001 From: Zxilly Date: Fri, 6 Jun 2025 04:18:02 +0800 Subject: [PATCH] remove type:string --- src/cmd/compile/internal/gc/obj.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/cmd/compile/internal/gc/obj.go b/src/cmd/compile/internal/gc/obj.go index 0f2e062277..5f5219673b 100644 --- a/src/cmd/compile/internal/gc/obj.go +++ b/src/cmd/compile/internal/gc/obj.go @@ -191,9 +191,12 @@ func dumpGlobalConst(n *ir.Name) { t = types.Types[types.TSTRING] } } else { - // If the type of the constant is an instantiated generic, we need to emit - // that type so the linker knows about it. See issue 51245. - _ = reflectdata.TypeLinksym(t) + if t.IsInteger() { + // If the type of the constant is an instantiated generic, we need to emit + // that type so the linker knows about it. See issue 51245. + _ = reflectdata.TypeLinksym(t) + } + // For const string, type:string isn't the real type. } if t.IsInteger() {