Open srikanth-sankaran opened 1 month ago
I've just ran into what seems to be the same problem:
sealed interface I {
enum E implements I {
A, B, C;
}
}
class Test {
void d(I i) {
switch (i) { // error: An enhanced switch statement should be exhaustive; a default label expected
case I.E.A -> {}
case I.E.B -> {}
case I.E.C -> {}
}
}
}
But there are no other valid cases (I
must be an E
, which must be A
, B
or C
).
Didn't test with javac.
Version: 2024-06 (4.32) Build id: I20240601-0610
I've just ran into what seems to be the same problem:
No, this is a different problem with the same symptom - I have raised https://github.com/eclipse-jdt/eclipse.jdt.core/issues/2720 with the test case.
This program compiles with javac, but ECJ complains about
A switch expression should have a default case
ECJ behavior is suspect - this is a follow up from https://github.com/eclipse-jdt/eclipse.jdt.core/issues/2714