Switch statement

Conventions for Labels

It may help readability for label names to indicate the direction (up or down)
that they jump. [10] In the example below, it
may be conventionally understood that the names continue and skip will jump down and the
name redo will jump up.

so, in a way, the rule against "jump into scope of local definition" is implied by the rule against "jump into nested block" (but not vice-versa). However, 5.2.0-beta-rc1 doesn't treat scoping between these two forms exactly analogously: if you add another ::a:: before the goto a, the former form will generate an error about duplicate label, whereas the latter will not (though it does in rc2) because the nested ::a:: is never seen by a goto outside the nested block (and any goto inside the nested block will only see the nested ::a::).

The particular treatment of labels at the end of the block (::b::) is what allows a loop continue construct to be implemented (example above) even when the loop block contains locals following the continue.

Efficiency

goto's can sometimes generate the exact same bytecodes and debuginfo as control structures, except for for loops: