]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/gc: do not report fields when looking for methods
authorRuss Cox <rsc@golang.org>
Mon, 16 Sep 2013 19:55:16 +0000 (15:55 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 16 Sep 2013 19:55:16 +0000 (15:55 -0400)
Fixes #6395.

R=ken2
CC=golang-dev
https://golang.org/cl/13470046

src/cmd/gc/subr.c

index b529e2cc9aa93c4eebe98b982d5c515ad012d4f1..bea90b87b8a5443f6db42291c1d6146cee50c7a4 100644 (file)
@@ -2183,7 +2183,7 @@ lookdot0(Sym *s, Type *t, Type **save, int ignorecase)
        c = 0;
        if(u->etype == TSTRUCT || u->etype == TINTER) {
                for(f=u->type; f!=T; f=f->down)
-                       if(f->sym == s || (ignorecase && ucistrcmp(f->sym->name, s->name) == 0)) {
+                       if(f->sym == s || (ignorecase && f->type->etype == TFUNC && f->type->thistuple > 0 && ucistrcmp(f->sym->name, s->name) == 0)) {
                                if(save)
                                        *save = f;
                                c++;