Skip to content

Commit cefd445

Browse files
committed
remove type:string
1 parent a2c54ef commit cefd445

File tree

1 file changed

+6
-3
lines changed
  • src/cmd/compile/internal/gc

1 file changed

+6
-3
lines changed

src/cmd/compile/internal/gc/obj.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,12 @@ func dumpGlobalConst(n *ir.Name) {
191191
t = types.Types[types.TSTRING]
192192
}
193193
} else {
194-
// If the type of the constant is an instantiated generic, we need to emit
195-
// that type so the linker knows about it. See issue 51245.
196-
_ = reflectdata.TypeLinksym(t)
194+
if t.IsInteger() {
195+
// If the type of the constant is an instantiated generic, we need to emit
196+
// that type so the linker knows about it. See issue 51245.
197+
_ = reflectdata.TypeLinksym(t)
198+
}
199+
// For const string, type:string isn't the real type.
197200
}
198201

199202
if t.IsInteger() {

0 commit comments

Comments
 (0)