Skip to content

Switch specification doesn't match implementation. #2354

Closed
@lrhn

Description

@lrhn

Implementations of switch currently throw an exception if a case (except the last one) reaches the end of the case body, i.e., where someone might mistakenly expect a fallthrough.

The specification doesn't say that this should happen, but instead just lets execution continue after the switch.

There doesn't seem to be consensus on which behavior is correct.

Metadata

Metadata

Assignees

Labels

area-languageDart language related items (some items might be better tracked at github.com/dart-lang/language).area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions