Interesting ... OP, I'm trying to look at your thought process. Maybe just write the code, what do you think it should look like (ignoring that it will not work in the first place).
update:
At least in C / C ++, you can simply create another block to have access only to the var variable in the switch:
... { var mySwitchVar = blah; switch(mySwitchVar) { case blah blah blah: default blah blah: } } ...
... { var mySwitchVar = blah; switch(mySwitchVar) { case blah blah blah: default blah blah: } } ...
source share