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

Inline method doesn't properly handle target of PrefixedIdentifier #57018

Open
stereotype441 opened this issue Nov 4, 2024 · 0 comments
Open
Labels
analyzer-refactoring analyzer-server 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 type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@stereotype441
Copy link
Member

Starting with the following code:

abstract class C {
  List<String> get myList;

  String get _first => myList.first;

  test() => _first.isNotEmpty;
}

Active the "inline method" refactoring on the method _first.

Expected result:

abstract class C {
  List<String> get myList;

  test() => myList.first.isNotEmpty;
}

Observed result:

abstract class C {
  List<String> get myList;

  test() => _first.myList.first; // Undefined name '_first'
}
@stereotype441 stereotype441 added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. analyzer-server analyzer-refactoring labels Nov 4, 2024
@srawlins srawlins added P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-refactoring analyzer-server 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 type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

2 participants