diff --git a/src/cmd/gc/walk.c b/src/cmd/gc/walk.c index 96cd4005412..60d5a9d022c 100644 --- a/src/cmd/gc/walk.c +++ b/src/cmd/gc/walk.c @@ -1945,8 +1945,13 @@ mkdotargs(Node *r, Node *rr, Iter *saver, Node *nn, Type *l, int fp) st = typ(TSTRUCT); // generated structure ft = T; // last field while(r != N) { + if(r->op == OLITERAL && r->val.ctype == CTNIL) { + if(r->type == T || r->type->etype == TNIL) { + yyerror("inappropriate use of nil in ... argument"); + return N; + } + } defaultlit(r, T); - if(r->type == T) // type check failed return N; diff --git a/test/bugs/bug153.go b/test/fixedbugs/bug153.go similarity index 100% rename from test/bugs/bug153.go rename to test/fixedbugs/bug153.go diff --git a/test/golden.out b/test/golden.out index 6a7756babb4..6bc8837d49c 100644 --- a/test/golden.out +++ b/test/golden.out @@ -108,10 +108,6 @@ BUG: should crash bugs/bug149.go:14: cannot convert []uint8 constant to string BUG: should compile -=========== bugs/bug153.go -BUG: errchk: bugs/bug153.go:9: error message does not match 'nil' -bugs/bug153.go:9: fatal error: dowidth: unknown type: E-34 - =========== fixedbugs/bug016.go fixedbugs/bug016.go:7: constant -3 overflows uint