(they must be pointers)
R=r
OCL=21009
CL=21009
if(n->op != ODCLFIELD || n->type == T)
fatal("stotype: oops %N\n", n);
- if(n->type->etype == TARRAY && n->type->bound < 0)
- yyerror("type of a structure field cannot be an open array");
+ switch(n->type->etype) {
+ case TARRAY:
+ if(n->type->bound < 0)
+ yyerror("type of a structure field cannot be an open array");
+ break;
+
+ case TCHAN:
+ case TMAP:
+ case TSTRING:
+ yyerror("%T can exist only in pointer form", n->type);
+ break;
+ }
switch(n->val.ctype) {
case CTSTR:
pushdcl(s);
}
+ if(t != T) {
+ switch(t->etype) {
+ case TCHAN:
+ case TMAP:
+ case TSTRING:
+ yyerror("%T can exist only in pointer form", t);
+ }
+ }
+
redeclare("variable", s);
s->vargen = gen;
s->oname = n;