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 class-like declaration named augmented #59773

Open
sgrekhov opened this issue Dec 20, 2024 · 1 comment
Labels
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 type-enhancement A request for a change that isn't a bug

Comments

@sgrekhov
Copy link
Contributor

In an augmentation scope augmented is a reserved world and can be used for calling introductory declaration only. Any other use of this word is a compile-time error. But there is no expected error in the analyzer below

class augmented {}

augment class augmented {}
//            ^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

main() {
  print(augmented);
}

Appropriate cp19 tests:
https://github.com/dart-lang/co19/blob/master/LanguageFeatures/Augmentation-libraries/augmented_expression_A09_t14.dart
https://github.com/dart-lang/co19/blob/master/LanguageFeatures/Augmentation-libraries/augmented_expression_A09_t15.dart
https://github.com/dart-lang/co19/blob/master/LanguageFeatures/Augmentation-libraries/augmented_expression_A09_t16.dart
https://github.com/dart-lang/co19/blob/master/LanguageFeatures/Augmentation-libraries/augmented_expression_A09_t17.dart
https://github.com/dart-lang/co19/blob/master/LanguageFeatures/Augmentation-libraries/augmented_expression_A09_t18.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 Dec 20, 2024
@srawlins srawlins added the type-enhancement A request for a change that isn't a bug label Dec 27, 2024
@keertip keertip added the P2 A bug or feature request we're likely to work on label Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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 type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants