Using OpenJDK 14.0.1
public class Example {
private String test(final ExampleEnum ee) {
return switch (ee) {
case Value -> null;
};
}
}
public enum ExampleEnum {
Value;
public enum InnerEnum {
}
}
Compilation fails with "the switch expression does not cover all possible input values". If I remove InnerEnum
from ExampleEnum
the code compiles. Why does the presence of this inner enum cause the switch expression to fail? Is there a logical explanation or a compiler bug?