diff options
| author | Russ Cox <rsc@golang.org> | 2009-12-15 16:22:04 -0800 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2009-12-15 16:22:04 -0800 |
| commit | 859b2db0b32b6c89c014cf1e83f277734475b931 (patch) | |
| tree | e056253aff7abc97b8538362dd3e747878603f21 /src/cmd/gc/subr.c | |
| parent | 5eb6118de9fe44c41bea4058f96ca78b093ec4f9 (diff) | |
| download | golang-859b2db0b32b6c89c014cf1e83f277734475b931.tar.gz | |
gc: bug fixes.
* better error for lookup of unexported field
* do not assign "ideal string" type to typed string literal
* do not confuse methods and fields during interface check
Fixes issue 410.
Fixes issue 411.
Fixes issue 426.
R=ken2
http://codereview.appspot.com/179069
Diffstat (limited to 'src/cmd/gc/subr.c')
| -rw-r--r-- | src/cmd/gc/subr.c | 6 |
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; } } |
