Commit 932794cb authored by Russ Cox's avatar Russ Cox

go/types: fix format errors

Found by pending CL to make cmd/vet auto-detect printf wrappers.

Change-Id: I1928a5bcd7885cdd950ce81b7d0ba07fbad3bf88
Reviewed-on: https://go-review.googlesource.com/109343
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 9e0e6981
...@@ -623,7 +623,7 @@ func (check *Checker) builtin(x *operand, call *ast.CallExpr, id builtinId) (_ b ...@@ -623,7 +623,7 @@ func (check *Checker) builtin(x *operand, call *ast.CallExpr, id builtinId) (_ b
// Note: trace is only available in self-test mode. // Note: trace is only available in self-test mode.
// (no argument evaluated yet) // (no argument evaluated yet)
if nargs == 0 { if nargs == 0 {
check.dump("%s: trace() without arguments", call.Pos()) check.dump("%v: trace() without arguments", call.Pos())
x.mode = novalue x.mode = novalue
break break
} }
...@@ -631,7 +631,7 @@ func (check *Checker) builtin(x *operand, call *ast.CallExpr, id builtinId) (_ b ...@@ -631,7 +631,7 @@ func (check *Checker) builtin(x *operand, call *ast.CallExpr, id builtinId) (_ b
x1 := x x1 := x
for _, arg := range call.Args { for _, arg := range call.Args {
check.rawExpr(x1, arg, nil) // permit trace for types, e.g.: new(trace(T)) check.rawExpr(x1, arg, nil) // permit trace for types, e.g.: new(trace(T))
check.dump("%s: %s", x1.pos(), x1) check.dump("%v: %s", x1.pos(), x1)
x1 = &t // use incoming x only for first argument x1 = &t // use incoming x only for first argument
} }
// trace is only available in test mode - no need to record signature // trace is only available in test mode - no need to record signature
......
...@@ -274,7 +274,7 @@ func (check *Checker) argument(fun ast.Expr, sig *Signature, i int, x *operand, ...@@ -274,7 +274,7 @@ func (check *Checker) argument(fun ast.Expr, sig *Signature, i int, x *operand,
typ = sig.params.vars[n-1].typ typ = sig.params.vars[n-1].typ
if debug { if debug {
if _, ok := typ.(*Slice); !ok { if _, ok := typ.(*Slice); !ok {
check.dump("%s: expected unnamed slice type, got %s", sig.params.vars[n-1].Pos(), typ) check.dump("%v: expected unnamed slice type, got %s", sig.params.vars[n-1].Pos(), typ)
} }
} }
default: default:
...@@ -448,7 +448,7 @@ func (check *Checker) selector(x *operand, e *ast.SelectorExpr) { ...@@ -448,7 +448,7 @@ func (check *Checker) selector(x *operand, e *ast.SelectorExpr) {
// lookup. // lookup.
mset := NewMethodSet(typ) mset := NewMethodSet(typ)
if m := mset.Lookup(check.pkg, sel); m == nil || m.obj != obj { if m := mset.Lookup(check.pkg, sel); m == nil || m.obj != obj {
check.dump("%s: (%s).%v -> %s", e.Pos(), typ, obj.name, m) check.dump("%v: (%s).%v -> %s", e.Pos(), typ, obj.name, m)
check.dump("%s\n", mset) check.dump("%s\n", mset)
panic("method sets and lookup don't agree") panic("method sets and lookup don't agree")
} }
......
...@@ -249,7 +249,7 @@ func (check *Checker) recordUntyped() { ...@@ -249,7 +249,7 @@ func (check *Checker) recordUntyped() {
for x, info := range check.untyped { for x, info := range check.untyped {
if debug && isTyped(info.typ) { if debug && isTyped(info.typ) {
check.dump("%s: %s (type %s) is typed", x.Pos(), x, info.typ) check.dump("%v: %s (type %s) is typed", x.Pos(), x, info.typ)
unreachable() unreachable()
} }
check.recordTypeAndValue(x, info.mode, info.typ, info.val) check.recordTypeAndValue(x, info.mode, info.typ, info.val)
......
...@@ -67,7 +67,7 @@ func (check *Checker) objDecl(obj Object, def *Named, path []*TypeName) { ...@@ -67,7 +67,7 @@ func (check *Checker) objDecl(obj Object, def *Named, path []*TypeName) {
d := check.objMap[obj] d := check.objMap[obj]
if d == nil { if d == nil {
check.dump("%s: %s should have been declared", obj.Pos(), obj) check.dump("%v: %s should have been declared", obj.Pos(), obj)
unreachable() unreachable()
} }
......
...@@ -382,7 +382,7 @@ func (check *Checker) updateExprType(x ast.Expr, typ Type, final bool) { ...@@ -382,7 +382,7 @@ func (check *Checker) updateExprType(x ast.Expr, typ Type, final bool) {
// The respective sub-expressions got their final types // The respective sub-expressions got their final types
// upon assignment or use. // upon assignment or use.
if debug { if debug {
check.dump("%s: found old type(%s): %s (new: %s)", x.Pos(), x, old.typ, typ) check.dump("%v: found old type(%s): %s (new: %s)", x.Pos(), x, old.typ, typ)
unreachable() unreachable()
} }
return return
......
...@@ -144,7 +144,7 @@ func (check *Checker) infoFromTypeLit(scope *Scope, iface *ast.InterfaceType, tn ...@@ -144,7 +144,7 @@ func (check *Checker) infoFromTypeLit(scope *Scope, iface *ast.InterfaceType, tn
} }
if trace { if trace {
check.trace(iface.Pos(), "-- collect methods for %s (path = %s)", iface, pathString(path)) check.trace(iface.Pos(), "-- collect methods for %v (path = %s)", iface, pathString(path))
check.indent++ check.indent++
defer func() { defer func() {
check.indent-- check.indent--
......
...@@ -487,7 +487,7 @@ func (check *Checker) interfaceType(ityp *Interface, iface *ast.InterfaceType, d ...@@ -487,7 +487,7 @@ func (check *Checker) interfaceType(ityp *Interface, iface *ast.InterfaceType, d
interfaceContext := check.context // capture for use in closure below interfaceContext := check.context // capture for use in closure below
check.later(func() { check.later(func() {
if trace { if trace {
check.trace(iface.Pos(), "-- delayed checking embedded interfaces of %s", iface) check.trace(iface.Pos(), "-- delayed checking embedded interfaces of %v", iface)
check.indent++ check.indent++
defer func() { defer func() {
check.indent-- check.indent--
...@@ -524,7 +524,7 @@ func (check *Checker) interfaceType(ityp *Interface, iface *ast.InterfaceType, d ...@@ -524,7 +524,7 @@ func (check *Checker) interfaceType(ityp *Interface, iface *ast.InterfaceType, d
// don't just assert, but report error since this // don't just assert, but report error since this
// used to be the underlying cause for issue #18395. // used to be the underlying cause for issue #18395.
if embed.allMethods == nil { if embed.allMethods == nil {
check.dump("%s: incomplete embedded interface %s", f.Type.Pos(), typ) check.dump("%v: incomplete embedded interface %s", f.Type.Pos(), typ)
unreachable() unreachable()
} }
// collect interface // collect interface
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment