mirror of
https://github.com/golang/go
synced 2024-11-26 01:37:58 -07:00
ANY is already checked separately,
so remove code from go.y. show original types in badtype; don't remove pointers. not sure why this was here but it confuses things if the bad part involves two named pointer types with different names but the same pointed-at type. R=ken OCL=31369 CL=31369
This commit is contained in:
parent
5ddaf9a098
commit
903d28bd1e
@ -1104,10 +1104,6 @@ othertype:
|
||||
$$ = T;
|
||||
break;
|
||||
}
|
||||
if($1->op == OTYPE)
|
||||
if($1->type->etype == TANY)
|
||||
if(strcmp(package, "PACKAGE") != 0)
|
||||
yyerror("the any type is restricted");
|
||||
$$ = oldtype($1->sym);
|
||||
}
|
||||
|
||||
|
@ -2120,21 +2120,6 @@ void
|
||||
badtype(int o, Type *tl, Type *tr)
|
||||
{
|
||||
|
||||
loop:
|
||||
switch(o) {
|
||||
case OCALL:
|
||||
if(tl == T || tr == T)
|
||||
break;
|
||||
if(isptr[tl->etype] && isptr[tr->etype]) {
|
||||
tl = tl->type;
|
||||
tr = tr->type;
|
||||
goto loop;
|
||||
}
|
||||
if(tl->etype != TFUNC || tr->etype != TFUNC)
|
||||
break;
|
||||
// if(eqtype(t1, t2))
|
||||
}
|
||||
|
||||
yyerror("illegal types for operand: %O", o);
|
||||
if(tl != T)
|
||||
print(" %T\n", tl);
|
||||
|
Loading…
Reference in New Issue
Block a user