Commit d7634ad7 authored by Rémy Oudompheng's avatar Rémy Oudompheng Committed by Russ Cox

gc: fix wrong arguments to error message for switches.

Fixes #2502.

R=golang-dev, rsc
CC=golang-dev, remy
https://golang.org/cl/5472062
parent d0cf3fa2
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment