Skip to content

Extract refactor can produce unnecessary_parenthesis trigger #56944

@FMorschel

Description

@FMorschel

Repro:

class A {
  void a() {
    (1 + 2);
  }
}

Now select (1 + 2) and the option to Extract Method.

Output:

class A {
  void a() {
    b();
  }

  void b() => (1 + 2);   // <-- unnecessary_parenthesis
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-refactoringIssues with analysis server refactoringstype-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