fatal("mapop: unknown op %O", n->op);
case OMAKE:
+ cl = listcount(n->left);
+ if(cl > 1)
+ yyerror("too many arguments to make map");
+
if(top != Erv)
goto nottop;
break;
a = n->left; // hint
- if(n->left == N)
+ if(cl != 1)
a = nodintconst(0);
+
r = a;
a = nodintconst(algtype(t->type)); // val algorithm
r = list(a, r);
fatal("chanop: unknown op %O", n->op);
case OMAKE:
+ cl = listcount(n->left);
+ if(cl > 1)
+ yyerror("too many arguments to make chan");
+
// newchan(elemsize int, elemalg int,
// hint int) (hmap *chan[any-1]);
if(t == T)
break;
- if(n->left != N) {
+ a = nodintconst(0);
+ if(cl == 1) {
// async buf size
a = nod(OCONV, n->left, N);
a->type = types[TINT];
- } else
- a = nodintconst(0);
+ }
r = a;
a = nodintconst(algtype(t->type)); // elem algorithm
Type *t, *tl;
Node *on;
Iter save;
+ int cl;
r = n;
switch(n->op) {
return n;
case OMAKE:
+ cl = listcount(n->left);
+ if(cl > 2)
+ yyerror("too many arguments to make array");
+
// newarray(nel int, max int, width int) (ary []any)
t = fixarray(n->type);
if(t == T)
int
BUG: should compile
-=========== bugs/bug122.go
-BUG: compilation succeeds incorrectly
-
=========== bugs/bug125.go
BUG: errchk: command succeeded unexpectedly: 6g bugs/bug125.go
I
*S
+=========== fixedbugs/bug122.go
+fixedbugs/bug122.go:6: too many arguments to make array
+
=========== fixedbugs/bug133.go
fixedbugs/bug133.dir/bug2.go:11: undefined DOT i on bug0.T
fixedbugs/bug133.dir/bug2.go:11: illegal types for operand: RETURN