To determine whether all cases are handled, we could use value range propagation.
OK
final switch (i % 2)
{
case 0:
case 1:
}
ERROR
final switch (i % 3)
{
case 0:
case 1:
}
In cases where we don't know the range, it should be an error.
Comment #1 by robert.schadek — 2024-12-13T18:50:30Z