Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.6
-
None
Description
The type checker is unable to infer the type of variable value in the below code:
abstract class Parent<T> { public T value } class Impl extends Parent<Integer> { } @CompileStatic class Test { public void test() { Impl impl = new Impl() Integer i = impl.value // fails } }
The compiler gives this error:
[Static type checking] - Cannot assign value of type java.lang.Object to variable of type java.lang.Integer