diff options
Diffstat (limited to 'src/cmd/compile/internal/noder')
| -rw-r--r-- | src/cmd/compile/internal/noder/types.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/cmd/compile/internal/noder/types.go b/src/cmd/compile/internal/noder/types.go index 3f3c9566ca..e7ce4c1089 100644 --- a/src/cmd/compile/internal/noder/types.go +++ b/src/cmd/compile/internal/noder/types.go @@ -239,10 +239,13 @@ func (g *irgen) typ0(typ types2.Type) *types.Type { // Save the name of the type parameter in the sym of the type. // Include the types2 subscript in the sym name pkg := g.tpkg(typ) - // Create the unique types1 name for a type param, using its context with a - // function, type, or method declaration. + // Create the unique types1 name for a type param, using its context + // with a function, type, or method declaration. Also, map blank type + // param names to a unique name based on their type param index. The + // unique blank names will be exported, but will be reverted during + // types2 and gcimporter import. assert(g.curDecl != "") - nm := g.curDecl + "." + typ.Obj().Name() + nm := typecheck.TparamExportName(g.curDecl, typ.Obj().Name(), typ.Index()) sym := pkg.Lookup(nm) if sym.Def != nil { // Make sure we use the same type param type for the same |
