Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.8.3
-
Fix Version/s: 1.8.5, 2.0-beta-2, 1.7.11
-
Component/s: class generator
-
Labels:None
-
Number of attachments :
Description
Instantiation fails at runtime if I have an inner class extending an inner class defined in the outer class's parent I get a NoSuchMethodError on instantiation. In other words, C2 extends C1 and C2.B extends C1.A yields C1$A: method <init>()V not found in C2.B's constructor. A repeatable test case is below:
class FailingInnerClassInheritance {
public static void main(String[] args) {
new C2()
}
}
class C1 {
class A {}
}
class C2 extends C1 {
{ new B() }
class B extends C1.A {}
}
The analogous example works in Java. It fails in Groovy even if we construct B later (after C2 construction) and try to supply various explicit constructors.
Nice, Cedric. Does this also squash
GROOVY-5122?