From 7486f5904a9e33b41f41e8275a314709fc05618a Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Tue, 26 Aug 2014 10:56:22 -0700 Subject: [PATCH] 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 --- go/types/builtins.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/go/types/builtins.go b/go/types/builtins.go index fcffa652..fae00863 100644 --- a/go/types/builtins.go +++ b/go/types/builtins.go @@ -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 }