Skip to content

Fall-through in the last case of a switch statement #7537

Closed
@DartBot

Description

@DartBot

This issue was originally filed by [email protected]


Spec "13.9 Switch" has follwing two assertions:

The last case in a switch (default or otherwise) can ‘fall-through’ to the end of the statement.
...
It is a static warning if the last statement of the statement sequence sk is not a
break, continue, return or throw statement.

To comply with the first assertion, the second assertion should be adjusted so that it does not apply to the last case in a switch.

Currently analyzer warns of "fall through" from the last case, which has no sense.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions