Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
I have the following program
class A<T1, T2> { void m1(T1 x) {} void test() { var x = new B(); T2 y = null; (new A<T2, T2>()).m1(x.m2(y)); } } class B { <X, Y> X m2(Y x) { return null; } }
Actual behaviour
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
test.groovy: 8: [Static type checking] - Cannot call A#m1(T2) with arguments [#X]
@ line 8, column 5.
(new A<T2, T2>()).m1(x.m2(y));
^
1 error
Expected behaviour
Compile successfully.
*Note*: If I change the expected type of parameter `x` in method `m1(T1 x)` to `m1(T2 x`), the program compiles as expected.
Tested against master