Skip to content
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

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

Closed
asashour opened this issue Jan 5, 2023 · 7 comments
Labels
area-meta Cross-cutting, high-level issues (for tracking many other implementation issues, ...). breaking-change-request This tracks requests for feedback on breaking changes

Comments

@asashour
Copy link
Contributor

asashour commented Jan 5, 2023

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.

@mit-mit mit-mit added area-meta Cross-cutting, high-level issues (for tracking many other implementation issues, ...). breaking-change-request This tracks requests for feedback on breaking changes labels Jan 5, 2023
@asashour
Copy link
Contributor Author

asashour commented Jan 19, 2023

https://dart-review.googlesource.com/c/sdk/+/279343

As the relevant CL has landed, the proposed CL adds CHANGELOG and closes this issue.

I hope that follows the breaking-changes process.

@itsjustkevin
Copy link
Contributor

@vsmenon @grouma @Hixie @eernstg could you take a look at this? It has been merged for a month now.

@eernstg
Copy link
Member

eernstg commented Feb 3, 2023

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?

@vsmenon
Copy link
Member

vsmenon commented Feb 3, 2023

lgtm - thanks!

@eernstg - is this a change in the spec or enforcement of existing spec?

@eernstg
Copy link
Member

eernstg commented Feb 3, 2023

Enforcement of existing spec.

@asashour
Copy link
Contributor Author

asashour commented Feb 3, 2023

The change has been implemented in 49c7d93

@grouma
Copy link
Member

grouma commented Feb 3, 2023

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-meta Cross-cutting, high-level issues (for tracking many other implementation issues, ...). breaking-change-request This tracks requests for feedback on breaking changes
Projects
None yet
Development

No branches or pull requests

6 participants