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

LinterContext.resolveNameInScope not properly resolving Object pattern vars #52486

Closed
pq opened this issue May 23, 2023 · 1 comment
Closed
Assignees
Labels
analyzer-linter Issues with the analyzer's support for the linter package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on

Comments

@pq
Copy link
Member

pq commented May 23, 2023

See: dart-lang/linter#4381

Simple repro from unnecessary_this which doesn't notice that the value var is shadowing.

class C {
  Object? value;

  bool equals(Object other) =>
      switch (other) { C(:var value) => this.value == value, _ => false };
}

/fyi @scheglov

@pq pq added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. analyzer-linter Issues with the analyzer's support for the linter package P2 A bug or feature request we're likely to work on labels May 23, 2023
@scheglov scheglov self-assigned this May 23, 2023
@scheglov
Copy link
Contributor

copybara-service bot pushed a commit that referenced this issue May 23, 2023
…on cases.

Bug: #52486
Change-Id: I7d00ed03f8da37e7adb2959a62acefbd1904770a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/305060
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-linter Issues with the analyzer's support for the linter package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

2 participants