1
0
mirror of https://github.com/golang/go synced 2024-09-29 13:34:30 -06:00

go/types, types2: don't print aliased type (in comments) for Alias types

Fixes #64584.

Change-Id: I756d6026d10f130c1dd5026891b7cc3c640d7f78
Reviewed-on: https://go-review.googlesource.com/c/go/+/548135
Reviewed-by: Alan Donovan <adonovan@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
This commit is contained in:
Robert Griesemer 2023-12-06 16:36:10 -08:00 committed by Gopher Robot
parent 2b4425759c
commit 5e724ccb2b
4 changed files with 2 additions and 6 deletions

View File

@ -998,7 +998,7 @@ type S struct{ A }
}
got := S.String()
const want = "type p.S struct{p.A /* = []int */}"
const want = "type p.S struct{p.A}"
if got != want {
t.Fatalf("got %q; want %q", got, want)
}

View File

@ -331,8 +331,6 @@ func (w *typeWriter) typ(typ Type) {
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:

View File

@ -1008,7 +1008,7 @@ type S struct{ A }
}
got := S.String()
const want = "type p.S struct{p.A /* = []int */}"
const want = "type p.S struct{p.A}"
if got != want {
t.Fatalf("got %q; want %q", got, want)
}

View File

@ -334,8 +334,6 @@ func (w *typeWriter) typ(typ Type) {
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: