oof. To me switch/case mentally implies constant time matching and routing, I wonder if that is the case (it could be if arrays have compile-time known length).
switch (x) {
case 0:
...
case 1 + 1:
...
}
This will behave in the normal way. But you can also have: switch {
case foo() > 0:
...
case bar() + baz() == s:
...
}
In which case it lowers to the corresponding if-else.