Declaring and initializing a local variable in one switch branch, then using that same local variable in a different switch branch, is legal but confusing. Even more so if the first switch branch returns rather than falling through. Let's just not do that.
Declaring and initializing a local variable in one
switch
branch, then using that same local variable in a differentswitch
branch, is legal but confusing. Even more so if the first switch branch returns rather than falling through. Let's just not do that.