Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
I have the following program
class A<T> { A(T x, B<T> y) {} } class B<X> {} class Test { void test() { new A<>("fda", new B<>()) } }
Actual behavior
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: test.groovy: 10: [Static type checking] - Cannot call A#<init>(java.lang.Object, B<java.lang.Object>) with arguments [java.lang.String, B<T>] @ line 10, column 5. new A<>("fda", new B<>()) ^ 1 error
Expected behavior
Compile successfully.
Tested against master (commit: 63bcab1bf13fb3811626fb1727c22e86528feb7f)
*Notes:*
- this bug occurs when the type parameters of class A and B involve different names
- this bug is not triggered is groovy 4.0.2. It is introduced in groovy 4.0.3.