Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.7.5, 1.7.6, 1.8.6
-
Tested on Fedora and Windows 7. Both show same issue.
Description
When you use the @InheritConstructors to pull all the constructors of a super class into a subclass this fails to work when it is used on an Inner Class. Below is an example of code that fails with error:
groovy.lang.GroovyRuntimeException: Could not find matching constructor for: D$F(D, java.lang.Integer)
when you would expect it to run.
import groovy.transform.InheritConstructors class A { def arg A(int arg) {this.arg=arg} } @InheritConstructors //add it here just in case that worked! class D { class E extends A { E(int arg) {super(arg)} } @InheritConstructors //this should make class F identical to class E class F extends A{} public test() { def test1=new E(1) //Works FINE. println test1.arg // prints 1 as expected def test2=new F(1) //throws GroovyRuntimeException here due to missing constructor. println test2.arg } } def test3=new D() test3.test()