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.