mirror of
https://github.com/golang/go
synced 2024-11-21 23:44:39 -07:00
gc: fix wrong arguments to error message for switches.
Fixes #2502. R=golang-dev, rsc CC=golang-dev, remy https://golang.org/cl/5472062
This commit is contained in:
parent
d0cf3fa21e
commit
d7634ad7d9
@ -878,7 +878,7 @@ typecheckswitch(Node *n)
|
||||
if(n->ntest)
|
||||
yyerror("invalid case %N in switch on %N (mismatched types %T and %T)", ll->n, n->ntest, ll->n->type, t);
|
||||
else
|
||||
yyerror("invalid case %N in switch (mismatched types %T and bool)", ll->n, n->ntest, ll->n->type, t);
|
||||
yyerror("invalid case %N in switch (mismatched types %T and bool)", ll->n, ll->n->type);
|
||||
} else if(nilonly && !isconst(ll->n, CTNIL)) {
|
||||
yyerror("invalid case %N in switch (can only compare %s %N to nil)", ll->n, nilonly, n->ntest);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user