cmd/compile: implement fmt.Formatter for *Type formats %s, %v

Change-Id: I878ac549430abc7859c30d176d52d52ce02c5827
Reviewed-on: https://go-review.googlesource.com/28333
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Robert Griesemer 2016-08-31 10:32:40 -07:00
parent 97ba3c8242
commit 8d0bbe2b48
22 changed files with 167 additions and 137 deletions

View file

@ -235,7 +235,7 @@ func (p *importer) verifyTypes() {
pt := pair.pt
t := pair.t
if !Eqtype(pt.Orig, t) {
formatErrorf("inconsistent definition for type %v during import\n\t%v (in %q)\n\t%v (in %q)", pt.Sym, Tconv(pt, FmtLong), pt.Sym.Importdef.Path, Tconv(t, FmtLong), importpkg.Path)
formatErrorf("inconsistent definition for type %v during import\n\t%2v (in %q)\n\t%2v (in %q)", pt.Sym, pt, pt.Sym.Importdef.Path, t, importpkg.Path)
}
}
}
@ -416,7 +416,7 @@ func (p *importer) importtype(pt, t *Type) {
}
if Debug['E'] != 0 {
fmt.Printf("import type %v %v\n", pt, Tconv(t, FmtLong))
fmt.Printf("import type %v %2v\n", pt, t)
}
}