1
0
mirror of https://github.com/golang/go synced 2024-11-23 15:40:06 -07:00

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
This commit is contained in:
Russ Cox 2014-02-20 15:42:08 -05:00
parent a8a7f18aea
commit 574e0f9a48

View File

@ -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,