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 is reported by the analyzer if augmented is used in switch in augmentation #56140

Open
sgrekhov opened this issue Jul 5, 2024 · 2 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

The following expected error is not reported by the analyzer.

// main.dart
import augment 'aug_lib.dart';

const augmented = "Constant augmented, shouldn't be used";
void set topLevelSetter(String value) {}

// aug_lib.dart
augment library 'main.dart';

augment void set topLevelSetter(String value) {
  switch ("") {
    case augmented:
//       ^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
    default:
  }
  var x = switch("") {
    augmented => 1,
//  ^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
    _ => 0
  };
}

See, for example, https://github.com/dart-lang/co19/blob/master/LanguageFeatures/Augmentation-libraries/augmented_expression_A02_t24.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 Jul 5, 2024
@sgrekhov sgrekhov changed the title [Augmentations] No error is reported by the analyzer if augmented is used in switch in aubmentation [Augmentations] No error is reported by the analyzer if augmented is used in switch in augmentation Jul 5, 2024
@keertip keertip added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) P1 A high priority bug; for example, a single project is unusable or has many test failures labels Jul 8, 2024
@keertip
Copy link
Contributor

keertip commented Jul 8, 2024

@scheglov

@srawlins
Copy link
Member

Ping on a P1 issue; feel free to re-categorize this as an "enhancement."

@scheglov scheglov 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 15, 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

4 participants