Skip to content

FIX #62280 Parser and analyzer AST should be updated to reject augmented enum values#62941

Open
Darkildo wants to merge 1 commit intodart-lang:mainfrom
Darkildo:Parser-and-analyzer-AST-should-be-updated-to-reject-augmented-enum-values
Open

FIX #62280 Parser and analyzer AST should be updated to reject augmented enum values#62941
Darkildo wants to merge 1 commit intodart-lang:mainfrom
Darkildo:Parser-and-analyzer-AST-should-be-updated-to-reject-augmented-enum-values

Conversation

@Darkildo
Copy link
Copy Markdown
Contributor

This PR aligns the parser and analyzer with dart-lang/language@ebd9e18, which removed support for augmenting enum values.

It changes the parser so code like:

enum E {
  foo
}

augment enum E {
  augment foo
}

is no longer accepted as a valid augmented enum constant declaration. Instead, the parser reports the leading augment as an extraneous modifier and recovers on the enum value name.

On the analyzer side, this PR also removes the internal use of enum-value augmentation data and deprecates EnumConstantDeclaration.augmentKeyword. That getter is part of the public analyzer API and is not experimental, so deprecating it now preserves semantic versioning and makes its future removal explicit.

The PR also updates parser and summary tests to reflect the new behavior.

Fix #62280

@copybara-service
Copy link
Copy Markdown

Thank you for your contribution! This project uses Gerrit for code reviews. Your pull request has automatically been converted into a code review at:

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

Please wait for a developer to review your code review at the above link; you can speed up the review if you sign into Gerrit and manually add a reviewer that has recently worked on the relevant code. See CONTRIBUTING.md to learn how to upload changes to Gerrit directly.

Additional commits pushed to this PR will update both the PR and the corresponding Gerrit CL. After the review is complete on the CL, your reviewer will merge the CL (automatically closing this PR).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parser and analyzer AST should be updated to reject augmented enum values

1 participant