Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
I have the following program
class A<X> { X x; A(X x) { this.x = x } } class Test<T> { void foo() { def closure = { T p -> "" } T y = null bar(new A<>(y).x) // works closure(new A<>(y).x) // fails } void bar(T x) {} }
Actual behavior
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: test.groovy: 15: [Static type checking] - Cannot call closure that accepts [T] with [X] @ line 15, column 12. closure(new A<>(y).x) // fails ^ 1 error
Expected behaviour
Compile successfully
Tested against master