Skip to content

Rename of getter/setter but not property or setter/getter can cause error for +=, ++, etc. #1014

@eric-milles

Description

@eric-milles

Consider the following:

class C {
  String foo
  void setFoo(String foo) { this.foo = foo }
}
@groovy.transform.CompileStatic
class D {
  void meth(C c) {
    c.foo += 'x'
    c.with {
      foo += 'y'
    }
  }
}

Renaming only setter "setFoo" also renames read/write expressions "foo += 'x'". No warning is given that read is still named "foo" and the end result is a compiler error for the new expression.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions