go.tools/go/types: added TODO re: misleading error message

Fix not urgent.

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/135810043
This commit is contained in:
Robert Griesemer 2014-08-26 10:56:22 -07:00
parent 4aaa1f6f6c
commit 7486f5904a
1 changed files with 4 additions and 0 deletions

View File

@ -495,6 +495,10 @@ func (check *Checker) builtin(x *operand, call *ast.CallExpr, id builtinId) (_ b
check.invalidArg(x.pos(), "%s has no single field %s", base, sel)
return
case *Func:
// TODO(gri) Using derefStructPtr may result in methods being found
// that don't actually exist. An error either way, but the error
// message is confusing. See: http://play.golang.org/p/al75v23kUy ,
// but go/types reports: "invalid argument: x.m is a method value".
check.invalidArg(arg0.Pos(), "%s is a method value", arg0)
return
}