Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.8, 4.0.0-alpha-3
-
None
Description
I have the following Groovy program.
@groovy.transform.TypeChecked class Test<T> { public void foo() { Foo<T, Long> x = new Foo<T, Long>(new Bar<T, Long>()); } } class Foo<X, T> { public Foo(Bar<X, T> y) {} } class Bar<X, T> {}
Actual Behavior
The program does not compile, and I get the following error.
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Test.groovy: 4: [Static type checking] - Cannot call Foo#<init>(Bar<T, java.lang.Long>) with arguments [Bar<T, java.lang.Long>] @ line 4, column 22. Foo<T, Long> x = new Foo<T, Long>(new Bar<T, Long>()); ^ 1 error
Expected Behavior
Compile successfully.
Affected Version
This programs have been tested with the compiler from the master (commit: c36c8bf3d24ce41e972e3f3e7a5763acf96f46b1), 4.0.0-alpha-3, and 3.0.8.