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

[Augmentations] No error when augmenting enum has no values #56883

Open
sgrekhov opened this issue Oct 11, 2024 · 1 comment
Open

[Augmentations] No error when augmenting enum has no values #56883

sgrekhov opened this issue Oct 11, 2024 · 1 comment
Labels
analyzer-spec Issues with the analyzer's implementation of the language spec area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. feature-augmentations Implementation of the augmentations feature P2 A bug or feature request we're likely to work on

Comments

@sgrekhov
Copy link
Contributor

The code below produce no expected error in the analyzer.

enum E1 {
  e0;
}

augment enum E1 {}
//           ^^
// [analyzer] unspecified
// [cfe] unspecified

But enum without any values must be a syntax error (even it is an augmenting declaration).

Appropriate failing co19 test https://github.com/dart-lang/co19/blob/master/LanguageFeatures/Augmentation-libraries/augmenting_enum_values_A03_t04.dart

@sgrekhov sgrekhov added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. feature-augmentations Implementation of the augmentations feature labels Oct 11, 2024
@eernstg
Copy link
Member

eernstg commented Oct 11, 2024

Yes, I'd expect a syntax error for that, too. I'm not aware of any grammar updates that would allow for the list of <enumEntry> terms to be empty.

@pq pq added analyzer-spec Issues with the analyzer's implementation of the language spec P2 A bug or feature request we're likely to work on labels Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-spec Issues with the analyzer's implementation of the language spec area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. feature-augmentations Implementation of the augmentations feature P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

3 participants