sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Renaming constructor that shares name with instance member results in invalid code

Open FMorschel opened this issue 5 months ago • 0 comments

Repro:

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

If you rename the constructor Foo.bar(), it makes the instance method call to bar inside the body be renamed too, with an added leading ..

Result:

class Foo {
  Foo.newName() {
    .newName();
  }
  void bar() {}
}

FMorschel avatar Jun 13 '25 13:06 FMorschel