Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.11
-
None
Description
I have the following program
class A<T> { T f; A(T f) { this.f = f; } } class B<T> { A<T> f; B(A<T> f) { this.f = f; } } class Test { void test() { def x = new B<>(new A<>((long) 1)).f; A<Long> y = x; } }
Actual behaviour
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: test.groovy: 18: [Static type checking] - Incompatible generic argument types. Cannot assign A<java.lang.Object> to: A<java.lang.Long> @ line 18, column 17. A<Long> y = x; ^ 1 error
Expected behaviour
Compile successfully
Tested against master