]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/cmd/compile/internal/types2/typestring.go
go/types, types2: introduce _Alias type node
[gostls13.git] / src / cmd / compile / internal / types2 / typestring.go
index dfa929476c4b073f22d8617afdf132b570d4ef9c..3c2150273ee85c54276cea8d1af37c9b710afb35 100644 (file)
@@ -322,10 +322,19 @@ func (w *typeWriter) typ(typ Type) {
                        // error messages. This doesn't need to be super-elegant; we just
                        // need a clear indication that this is not a predeclared name.
                        if w.ctxt == nil && Universe.Lookup(t.obj.name) != nil {
-                               w.string(sprintf(nil, false, " /* with %s declared at %s */", t.obj.name, t.obj.Pos()))
+                               w.string(fmt.Sprintf(" /* with %s declared at %s */", t.obj.name, t.obj.Pos()))
                        }
                }
 
+       case *_Alias:
+               w.typeName(t.obj)
+               if w.ctxt != nil {
+                       // TODO(gri) do we need to print the alias type name, too?
+                       w.typ(_Unalias(t.obj.typ))
+               } else {
+                       w.string(fmt.Sprintf(" /* = %s */", _Unalias(t.obj.typ)))
+               }
+
        default:
                // For externally defined implementations of Type.
                // Note: In this case cycles won't be caught.