Skip to content

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

Closed
@stereotype441

Description

@stereotype441

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'
}

Metadata

Metadata

Assignees

Labels

P2A bug or feature request we're likely to work ondevexp-refactoringIssues with analysis server refactoringsdevexp-serverIssues related to some aspect of the analysis serverlegacy-area-analyzerUse area-devexp instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions