Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
I have the following program
class A<T> { void foo() { T z = null; T x = new B<>(z).f // does not work String y = "" String k = new B<>(y).f // works } } class B<X> { X f; B(X f) { this.f = f; } }
Actual behaviour
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: test.groovy: 4: [Static type checking] - Cannot assign value of type X to variable of type T @ line 4, column 11. T x = new B<>(z).f // does not work ^1 error
Expected behaviour
Compile successfully
Tested against master