Specification of continue
behavior inside a switch statement makes no sense
#30011
Labels
area-language
Dart language related items (some items might be better tracked at github.com/dart-lang/language).
area-specification
closed-duplicate
Closed in favor of an existing report
The Dart language spec says:
But for the typical usage of
continue
within a switch statement, the target of thecontinue
statement typically doesn't encloses_c
. For example:If we took the spec literally, the target of a
continue
statement inside a switch would only be able to point to the originating case clause, which effectively allows turning a case clause into a loop. I'm pretty sure that wasn't the intent.I think the language should be adjusted to say something like this:
...which allows continue expressions within switch statements to jump from one case clause to another.
I've verified that analyzer, dart2js, and the VM all behave consistently with the proposed spec change.
The text was updated successfully, but these errors were encountered: