summaryrefslogtreecommitdiff
path: root/src/cmd
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-02-20 15:42:08 -0500
committerRuss Cox <rsc@golang.org>2014-02-20 15:42:08 -0500
commit574e0f9a4833a0c81bc4ea7efd9ea9bb46cb59b9 (patch)
tree248af1a37ca0e74ca892b17200c827c661c80650 /src/cmd
parenta8a7f18aeaf66e74f4f89b95d6cd43bab6cbf59d (diff)
downloadgo-git-574e0f9a4833a0c81bc4ea7efd9ea9bb46cb59b9.tar.gz
cmd/gc: explain 'nointerface' method failure
The message used to say that there was a type mismatch, which is not necessarily true. TBR=ken2 CC=golang-codereviews https://golang.org/cl/66600044
Diffstat (limited to 'src/cmd')
-rw-r--r--src/cmd/gc/subr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cmd/gc/subr.c b/src/cmd/gc/subr.c
index f71165d456..a32590e003 100644
--- a/src/cmd/gc/subr.c
+++ b/src/cmd/gc/subr.c
@@ -1239,6 +1239,9 @@ assignop(Type *src, Type *dst, char **why)
if(why != nil) {
if(isptrto(src, TINTER))
*why = smprint(":\n\t%T is pointer to interface, not interface", src);
+ else if(have && have->sym == missing->sym && have->nointerface)
+ *why = smprint(":\n\t%T does not implement %T (%S method is marked 'nointerface')",
+ src, dst, missing->sym);
else if(have && have->sym == missing->sym)
*why = smprint(":\n\t%T does not implement %T (wrong type for %S method)\n"
"\t\thave %S%hhT\n\t\twant %S%hhT", src, dst, missing->sym,