Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
eric-milles opened this issue Dec 30, 2019 · 0 comments
Assignees
Labels
Milestone

Comments

@eric-milles
Copy link
Member

eric-milles commented Dec 30, 2019

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.

@eric-milles eric-milles changed the title Rename of setter but not property can cause error for +=, ++, etc. Rename of getter/setter but not setter/getter or property can cause error for +=, ++, etc. Dec 30, 2019
@eric-milles eric-milles changed the title Rename of getter/setter but not setter/getter or property can cause error for +=, ++, etc. Rename of getter/setter but not property or setter/getter can cause error for +=, ++, etc. Dec 30, 2019
@eric-milles eric-milles self-assigned this Jan 1, 2020
@eric-milles eric-milles added the bug label Jan 1, 2020
@eric-milles eric-milles added this to the v3.7.0 milestone Jan 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant