Commit d94409d6 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

go/types: fix bad printf verbs

This fixes the following vet warnings:

go/types/builtins.go:437: arg call for printf verb %s of wrong type: *go/ast.CallExpr
go/types/builtins.go:598: arg call for printf verb %s of wrong type: *go/ast.CallExpr

Updates #11041

Change-Id: I746d054e8e49b330fbdf961912a98f55dd5f3ff9
Reviewed-on: https://go-review.googlesource.com/26997
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
parent e0d8064e
...@@ -434,7 +434,7 @@ func (check *Checker) builtin(x *operand, call *ast.CallExpr, id builtinId) (_ b ...@@ -434,7 +434,7 @@ func (check *Checker) builtin(x *operand, call *ast.CallExpr, id builtinId) (_ b
return return
} }
if nargs < min || min+1 < nargs { if nargs < min || min+1 < nargs {
check.errorf(call.Pos(), "%s expects %d or %d arguments; found %d", call, min, min+1, nargs) check.errorf(call.Pos(), "%v expects %d or %d arguments; found %d", call, min, min+1, nargs)
return return
} }
var sizes []int64 // constant integer arguments, if any var sizes []int64 // constant integer arguments, if any
...@@ -595,7 +595,7 @@ func (check *Checker) builtin(x *operand, call *ast.CallExpr, id builtinId) (_ b ...@@ -595,7 +595,7 @@ func (check *Checker) builtin(x *operand, call *ast.CallExpr, id builtinId) (_ b
return return
} }
if !constant.BoolVal(x.val) { if !constant.BoolVal(x.val) {
check.errorf(call.Pos(), "%s failed", call) check.errorf(call.Pos(), "%v failed", call)
// compile-time assertion failure - safe to continue // compile-time assertion failure - safe to continue
} }
// result is constant - no need to record signature // result is constant - no need to record signature
......
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