Skip to content

Cannot inline refactor method that is invoked using a cascade operator #53433

Open
@alanrussian

Description

@alanrussian

When I try to refactor a Dart method that is invoked using the cascade operator, I get this error: "Cannot inline cascade invocation." This appears to be coming from here:

'Cannot inline cascade invocation.', newLocation_fromNode(usage));

For example:

class Foo {
  void bar() {
    baz();
  }

  void baz() {}
}

void main() {
  final myFoo = Foo()..bar();
}
  1. Copy this into VSCode.
  2. Right click bar, click refactor, then click inline.

Expected:

class Foo {
  void baz() {}
}

void main() {
  final myFoo = Foo()..baz();
}
  • Dart version and tooling diagnostic info (dart info): The current one in google3 (not sure if I can share here)
  • Whether you are using Windows, macOS, or Linux (if applicable): Linux
  • Whether you are using Chrome, Safari, Firefox, Edge (if applicable): N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.customer-google3devexp-serverIssues related to some aspect of the analysis servertype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions