1
0
mirror of https://github.com/golang/go synced 2024-11-12 02:10:21 -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:
Rémy Oudompheng 2011-12-12 16:08:32 -05:00 committed by Russ Cox
parent d0cf3fa21e
commit d7634ad7d9

View File

@ -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);
}