You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The switch statement is actually underspecified in this respect. It does not say that the switch expression has to fit into a basic type. So technically, I believe gotype is correct. That said, I think the spec needs to be clarified as the current situation is not tenable in general. Leaving as go/types bug.
Activity
dvyukov commentedon Jul 11, 2015
The same happens in switch cases as well:
griesemer commentedon Jul 11, 2015
The switch statement is actually underspecified in this respect. It does not say that the switch expression has to fit into a basic type. So technically, I believe gotype is correct. That said, I think the spec needs to be clarified as the current situation is not tenable in general. Leaving as go/types bug.
gopherbot commentedon Jul 27, 2015
CL https://golang.org/cl/12713 mentions this issue.
[-]x/tools/go/types: int overflow in switch expression[/-][+]go/types: int overflow in switch expression[/+]