exhaustive
exhaustive copied to clipboard
superfluous type conversion in case clause results in a false positive report
type M int
const (
A M = iota
B
)
func quux(v M) {
switch v {
case M(A):
}
}
For the program above, exhaustive currently incorrectly reports:
missing cases in switch of type M: A, B
However, it should only report B as missing:
missing cases in switch of type M: B
Notes
The issue is that exhaustive seems to be confused by the (superfluous) type conversion in case M(A):
. If it were just case A:
, exhaustive correctly reports only B as missing:
missing cases in switch of type M: B