summaryrefslogtreecommitdiff
path: root/src/cmd/gc/subr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/gc/subr.c')
-rw-r--r--src/cmd/gc/subr.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cmd/gc/subr.c b/src/cmd/gc/subr.c
index 407dea023..d79e5b88c 100644
--- a/src/cmd/gc/subr.c
+++ b/src/cmd/gc/subr.c
@@ -320,7 +320,7 @@ Sym*
restrictlookup(char *name, char *pkg)
{
if(!exportname(name) && strcmp(pkg, package) != 0)
- yyerror("cannot refer to %s.%s", pkg, name);
+ yyerror("cannot refer to unexported name %s.%s", pkg, name);
return pkglookup(name, pkg);
}
@@ -2871,6 +2871,10 @@ ifacelookdot(Sym *s, Type *t, int *followptr)
break;
}
}
+ if(m->type->etype != TFUNC || m->type->thistuple == 0) {
+ yyerror("%T.%S is a field, not a method", t, s);
+ return T;
+ }
return m;
}
}