-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Breaking change: compile-time error for continue
statement having invalid target
#50902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
https://dart-review.googlesource.com/c/sdk/+/279343 As the relevant CL has landed, the proposed CL adds I hope that follows the breaking-changes process. |
This is a bug fix that eliminates a soundness issue. The update in https://dart-review.googlesource.com/c/sdk/+/279343 was a new entry in CHANGELOG.md, which means that it (presumably) hasn't been implemented, but I doubt that there is any other way ahead than implementing it. @vsmenon, @grouma, @Hixie, do you see a reason to reject this request? |
lgtm - thanks! @eernstg - is this a change in the spec or enforcement of existing spec? |
Enforcement of existing spec. |
The change has been implemented in 49c7d93 |
LGTM |
Change
A compile-time error will be triggered for
continue
statement targeting invalid labeled statements (which are notfor
,do
,while
, orswitch
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.
The text was updated successfully, but these errors were encountered: