Details
-
Sub-task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Even the inheritance is correct - the following sample returns a:
Exception in thread "main" groovy.lang.MissingMethodException: No signature of method: test.Child.parentMethodB() is applicable for argument types: () values: {}
package test public class Parent{ private String parentMethodB(){ return "parentMethodB"; } protected String parentMethodC(){ def closure={ return parentMethodB()} return closure() } }
package test public class Child extends Parent{ public static void main(def args){ Child c = new Child(); println(c.parentMethodC()) } }
Attachments
Issue Links
- depends upon
-
GROOVY-2503 MOP 2.0 design inflluencing issues
- Open
-
GROOVY-3010 fix private field visibility
- Open
- is duplicated by
-
GROOVY-2565 Exception with inheritance and private method calls from a closure
- Closed
- is related to
-
GROOVY-2433 Closure in base class unable to call private methods when invoked from derived class
- Closed
-
GROOVY-5438 Private field inaccessible in closure when using a subclass
- Closed
- relates to
-
GROOVY-3142 Unable to access inherited private fields from a closure within an inherited method
- Closed