Consider:
type A [1]int
func f(x A) {
switch x {
case A([1]int{1}):
case A([1]int{1}):
}
}
This is almost certainly a typo; the second case is unreachable. The compiler may reject duplicate constant cases in expression switches, but not e.g. nil or composite literals containing constants. (See #15896 for discussion.) Perhaps cmd/vet should step in to help catch these likely bugs. This issue is a reminder to investigate.
Consider:
This is almost certainly a typo; the second case is unreachable. The compiler may reject duplicate constant cases in expression switches, but not e.g.
nilor composite literals containing constants. (See #15896 for discussion.) Perhaps cmd/vet should step in to help catch these likely bugs. This issue is a reminder to investigate.