Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1.6, 2.2.0-beta-1, 2.3.0, 2.4.0-rc-1
-
None
Description
class Foo { private getX() {1}} class Bar extends Foo {public x=2} @groovy.transform.CompileStatic def foo() { return new Bar().x } assert foo()==2
The above example fails at compile time because existsProperty first looks for a getter and finds the private one in Foo. This getter is inaccessible from foo() even in normal Groovy, and should have been ignored instead. If it had been ignored existsProperty might have found Bar#x as a better fit instead