fix method function type compare bug

R=ken
OCL=17815
CL=17815
This commit is contained in:
Russ Cox 2008-10-24 14:29:01 -07:00
parent 63ed2b710b
commit 0be746d581
2 changed files with 6 additions and 3 deletions

View 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;
}
}

View 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;