Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.4.7
-
None
Description
Example:
@groovy.transform.CompileStatic class A { private int bar() { 123 } class B { int testInner() { new C().barInner() } class C { int barInner() { bar() } } } int test() { new B().testInner() } } assert new A().test() == 123
The code above fails with the following error at runtime:
org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'A$B@4c1d9d4b' with class 'A$B' to class 'A'
This occurs because the bridge method owner for an 'implicit this' private method call is assumed to be the immediate outer class.
Attachments
Issue Links
- links to