Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.6-rc-1
-
None
-
None
Description
class A {
def final foo()
{ bar() }private final String bar()
{ return "Bar" }}
class B extends A {}
class C {}
C.metaClass {
mixin B
}
def c= new C()
c.foo()
Running the script results in "Caught: groovy.lang.MissingMethodException: No signature of method: C.bar() is applicable for argument types: () values: {}". Changing the bar's visibility to non-private or mixing in A instead of B helps here.
I assume the problem is that bar() is not directly visible in B, but since I'm calling bar() from foo(), which is defined in A, I would expect the code to work.
Looks like calling private methods (bar) from inherited mixed-in methods (foo) is not possible?