Skip to content

Breaking change: compile-time error for continue statement having invalid target #50902

@asashour

Description

@asashour

Change

A compile-time error will be triggered for continue statement targeting invalid labeled statements (which are not for, do, while, or switch case).

Original issue is #49852, see also dart-lang/language#2586

Note: there is already continue_label_on_switch, which would be part of the new error.

Rationale

As per 18.15 of the specs, it is a compile-time error for the continue label to target non-loops or switch members.

Impact

There is a chance that some invalid usage is encountered.

Mitigation

Users have to change the code and properly target valid labeled statements.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-metaCross-cutting, high-level issues (for tracking many other implementation issues, ...).breaking-change-requestThis tracks requests for feedback on breaking changes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions