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

Invalid fixes being suggested #55804

Closed
bwilkerson opened this issue May 21, 2024 · 2 comments
Closed

Invalid fixes being suggested #55804

bwilkerson opened this issue May 21, 2024 · 2 comments
Assignees
Labels
analyzer-quick-fix area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P3 A lower priority bug or feature request type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) type-ux A user experience or user interface related issue

Comments

@bwilkerson
Copy link
Member

Given a file containing the following:

void f(C c) {
  var x = c.x;
  print(x);
}

class C {}

Server will suggest four fixes, only two of which are reasonable:

  • Create getter 'x'
  • Create local variable 'x'
  • Create mixin 'x'
  • Create field 'x'

It should not be suggesting to create either a mixin or a local variable because neither of these would leave the code in a valid state.

@bwilkerson bwilkerson added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P3 A lower priority bug or feature request analyzer-quick-fix type-ux A user experience or user interface related issue labels May 21, 2024
@srawlins srawlins added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label May 24, 2024
@scheglov scheglov self-assigned this May 29, 2024
@scheglov
Copy link
Contributor

@scheglov
Copy link
Contributor

copybara-service bot pushed a commit that referenced this issue May 29, 2024
… of property.

Bug: #55804
Change-Id: Ibbdeac3a662ef140fb88e834416f064c899365bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368681
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
copybara-service bot pushed a commit that referenced this issue May 29, 2024
…s a name of property.

Bug: #55804
Change-Id: Ib61c025855464e1b7f01116234624d936ee9bc89
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368701
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-quick-fix area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P3 A lower priority bug or feature request type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) type-ux A user experience or user interface related issue
Projects
None yet
Development

No branches or pull requests

3 participants