]> Cypherpunks repositories - gostls13.git/commitdiff
fix method function type compare bug
authorRuss Cox <rsc@golang.org>
Fri, 24 Oct 2008 21:29:01 +0000 (14:29 -0700)
committerRuss Cox <rsc@golang.org>
Fri, 24 Oct 2008 21:29:01 +0000 (14:29 -0700)
R=ken
OCL=17815
CL=17815

src/cmd/gc/dcl.c
src/cmd/gc/subr.c

index f836f3ba749606ee7f3aee1100f38b80f8745719..9f888484dc4495992a92eb455b4ea9bff7971484 100644 (file)
@@ -279,8 +279,10 @@ addmethod(Node *n, Type *t, int local)
                        d = f;
                        continue;
                }
-               if(!eqtype(t, f->type, 0))
+               if(!eqtype(t, f->type, 0)) {
                        yyerror("method redeclared: %S of type %S", sf, st);
+                       print("\t%T\n\t%T\n", f->type, t);
+               }
                return;
        }
 
@@ -340,7 +342,8 @@ funchdr(Node *n)
                        if(!eqargs(n->type, on->type))
                                yyerror("forward declarations not the same: %S", s);
                } else {
-                       yyerror("redeclare of function: %S", s);
+                       yyerror("function redeclared: %S", s);
+                       print("\t%T\n\t%T\n", on->type, n->type);
                        on = N;
                }
        }
index 4e1a9ea3a36b8edb4aa369de1cc9ad6d19194194..dfe5913d21fda9769267a295d5b013c26ec1e560 100644 (file)
@@ -1773,7 +1773,7 @@ eqtype(Type *t1, Type *t2, int d)
                        if(t1->etype != TSTRUCT || t2->etype != TSTRUCT)
                                return 0;
 
-                       if(!eqtype(t1->type, t2->type, 0))
+                       if(!eqtype(t1, t2, 0))
                                return 0;
 
                        t1 = t1->down;