]> Cypherpunks repositories - gostls13.git/commitdiff
ANY is already checked separately,
authorRuss Cox <rsc@golang.org>
Wed, 8 Jul 2009 23:39:19 +0000 (16:39 -0700)
committerRuss Cox <rsc@golang.org>
Wed, 8 Jul 2009 23:39:19 +0000 (16:39 -0700)
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

src/cmd/gc/go.y
src/cmd/gc/subr.c

index bb1edbd7ea82bcc712635d5d4196d16f483f89c1..046db1d91412792ec13fc4142e85e6c58c675d18 100644 (file)
@@ -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);
        }
 
index a1c66d1179c34593784ed2b0c62832b33c2d0169..9c5d2c1264df0b2247a7ebac09d542457ffece43 100644 (file)
@@ -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);