go.tools/go/types: minor internal cleanup

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/80960046
This commit is contained in:
Robert Griesemer 2014-03-27 10:03:51 -07:00
parent 2414677bb9
commit 33f2a1701b
1 changed files with 7 additions and 9 deletions

View File

@ -187,16 +187,14 @@ func writeType(buf *bytes.Buffer, this *Package, typ Type, visited []Type) {
case *Named:
s := "<Named w/o object>"
if obj := t.obj; obj != nil {
if obj.pkg != nil {
if obj.pkg != this {
buf.WriteString(obj.pkg.path)
buf.WriteByte('.')
}
// TODO(gri): function-local named types should be displayed
// differently from named types at package level to avoid
// ambiguity.
if pkg := obj.pkg; pkg != nil && pkg != this {
buf.WriteString(pkg.path)
buf.WriteByte('.')
}
s = t.obj.name
// TODO(gri): function-local named types should be displayed
// differently from named types at package level to avoid
// ambiguity.
s = obj.name
}
buf.WriteString(s)