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
Note that changing the case BAR, BAZ into separate cases like this:
caseBAR -> {
}
caseBAZ -> {
}
Makes the check work as expected:
src/main/java/example/Hello.java:18: error: [UnnecessaryDefaultInEnumSwitch] Switch handles all enum values: the default case can be omitted to enable enforcement at compile-time that the switch statement is exhaustive.
default -> throw new AssertionError(type);
^
(see https://errorprone.info/bugpattern/UnnecessaryDefaultInEnumSwitch)
This is with bazel version 7.2.0. I'm not sure what version of error-prone that is (not super familiar with bazel).
With
UnnecessaryDefaultInEnumSwitch
set toERROR
, the following code:Does not error but I would expect it to.
Note that changing the
case BAR, BAZ
into separate cases like this:Makes the check work as expected:
This is with bazel version 7.2.0. I'm not sure what version of error-prone that is (not super familiar with bazel).
I pushed a minimal example repo for this here: https://github.com/robinst/error-prone-unnecessary-default
The text was updated successfully, but these errors were encountered: