Closed
Description
by bslesinsky:
What steps will reproduce the problem? type Color bool; const ( Black = false; White = true; ) func (c Color) String() string { switch c { case White: return "White"; case Black: return "Black"; } panic("not reachable"); } What is the expected output? What do you see instead? I think this should compile, but I get: gongo.go:66: case true (type bool) in Color switch gongo.go:66: case false (type bool) in Color switch What is your $GOOS? $GOARCH? $ echo $GOOS $GOARCH darwin 386 Which revision are you using? (hg identify) $ hg identify 44699e529c44+ tip An easy workaround is to rewrite it like this: switch { case c == White: return "White"; case c == Black: return "Black"; }