case CTNIL:
switch(et) {
default:
- yyerror("cannot use nil as %T", t);
n->type = T;
goto bad;
assignconv(Node *n, Type *t, char *context)
{
int op;
- Node *r;
+ Node *r, *old;
char *why;
if(n == N || n->type == T)
return n;
+ old = n;
+ old->diag++; // silence errors about n; we'll issue one below
defaultlit(&n, t);
+ old->diag--;
if(t->etype == TBLANK)
return n;
_ = sum()
_ = sum(1.0, 2.0)
_ = sum(1.5) // ERROR "integer"
- _ = sum("hello") // ERROR "convert|incompatible"
+ _ = sum("hello") // ERROR "string.*as type int|incompatible"
_ = sum([]int{1}) // ERROR "slice literal.*as type int|incompatible"
)