Details
-
Sub-task
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
If a class defines a private field and a method that uses a closures referencing this private field, then a groovy.lang.MissingPropertyException is thrown any time this method is called from a subclass.
It can be reproduced in the groovy console with the script in attachment. If "iterate" is called on the parent it works (text is appended to stdout - no exception), but if it is called from the subclass it fails (only the text from outside the closure is displayed and then an exception is thrown).
This issue come from a deeper investigation on http://groovy.329449.n5.nabble.com/Exception-when-extending-ASTTransformationCustomizer-td5630073.html
Attachments
Attachments
Issue Links
- is duplicated by
-
GROOVY-10723 Closure in parent class can't access private method in same class when called from a child class
- Closed
- relates to
-
GROOVY-2433 Closure in base class unable to call private methods when invoked from derived class
- Closed
-
GROOVY-3073 Private inheritance bug: Closure accessing private method
- Closed
-
GROOVY-3142 Unable to access inherited private fields from a closure within an inherited method
- Closed
-
GROOVY-3010 fix private field visibility
- Open