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 in the analyzer if augmented is torn-off inside of an augmenting operator #56142

Open
sgrekhov opened this issue Jul 5, 2024 · 0 comments
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. feature-augmentations Implementation of the augmentations feature P1 A high priority bug; for example, a single project is unusable or has many test failures type-enhancement A request for a change that isn't a bug

Comments

@sgrekhov
Copy link
Contributor

sgrekhov commented Jul 5, 2024

According to the specification

When augmenting an operator, augmented must be followed by the operator.

But see, for example https://github.com/dart-lang/co19/blob/master/LanguageFeatures/Augmentation-libraries/augmented_expression_A05_t01_lib1.dart

const augmented = "Augmented constant, should not be used";

augment class C {
  augment int operator +(Object other) {
    var f = augmented; // No expected error in the analyzer
//          ^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
    return 0;
  }
}
@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 Jul 5, 2024
@keertip keertip added P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Jul 8, 2024
@srawlins srawlins added type-enhancement A request for a change that isn't a bug and removed type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Jul 17, 2024
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 P1 A high priority bug; for example, a single project is unusable or has many test failures type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants