mirror of
https://github.com/golang/go
synced 2024-11-20 10:14:43 -07:00
gc: remove duplicate errors, give better error for I.(T)
R=ken2 CC=golang-dev https://golang.org/cl/370041
This commit is contained in:
parent
e00795859b
commit
529369e452
@ -79,7 +79,7 @@ errcmp(const void *va, const void *vb)
|
|||||||
return a->lineno - b->lineno;
|
return a->lineno - b->lineno;
|
||||||
if(a->seq != b->seq)
|
if(a->seq != b->seq)
|
||||||
return a->seq - b->seq;
|
return a->seq - b->seq;
|
||||||
return 0;
|
return strcmp(a->msg, b->msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -91,7 +91,8 @@ flusherrors(void)
|
|||||||
return;
|
return;
|
||||||
qsort(err, nerr, sizeof err[0], errcmp);
|
qsort(err, nerr, sizeof err[0], errcmp);
|
||||||
for(i=0; i<nerr; i++)
|
for(i=0; i<nerr; i++)
|
||||||
print("%s", err[i].msg);
|
if(i==0 || strcmp(err[i].msg, err[i-1].msg) != 0)
|
||||||
|
print("%s", err[i].msg);
|
||||||
nerr = 0;
|
nerr = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3082,11 +3083,19 @@ runifacechecks(void)
|
|||||||
needexplicit = 1;
|
needexplicit = 1;
|
||||||
}
|
}
|
||||||
if(wrong) {
|
if(wrong) {
|
||||||
if(samename)
|
if(p->explicit) {
|
||||||
yyerror("%T is not %T\n\tmissing %S%hhT\n\tdo have %S%hhT",
|
if(samename)
|
||||||
t, iface, m->sym, m->type, samename->sym, samename->type);
|
yyerror("%T cannot contain %T\n\tmissing %S%hhT\n\tdo have %S%hhT",
|
||||||
else
|
iface, t, m->sym, m->type, samename->sym, samename->type);
|
||||||
yyerror("%T is not %T\n\tmissing %S%hhT", t, iface, m->sym, m->type);
|
else
|
||||||
|
yyerror("%T cannot contain %T\n\tmissing %S%hhT", iface, t, m->sym, m->type);
|
||||||
|
} else {
|
||||||
|
if(samename)
|
||||||
|
yyerror("%T is not %T\n\tmissing %S%hhT\n\tdo have %S%hhT",
|
||||||
|
t, iface, m->sym, m->type, samename->sym, samename->type);
|
||||||
|
else
|
||||||
|
yyerror("%T is not %T\n\tmissing %S%hhT", t, iface, m->sym, m->type);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(!p->explicit && needexplicit) {
|
else if(!p->explicit && needexplicit) {
|
||||||
if(m) {
|
if(m) {
|
||||||
|
Loading…
Reference in New Issue
Block a user