Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.4.0-beta-3
-
None
-
Groovy Version: 2.4.0-beta-3 JVM: 1.8.0_25 Vendor: Oracle Corporation OS: Mac OS X
Description
Target type inference makes an STC Error when the target is java.lang.Integer:
static <T> T empty() {..} Integer i = empty(); //[Static type checking] - Cannot assign value of type T to variable of type java.lang.Integer
Even if we specify the type explicitly, STC says same error:
Integer i2 = TargetTypeTestGroovy.<Integer>empty(); // [Static type checking] - Cannot assign value of type T to variable of type java.lang.Integer
If we use java.lang.String instead of java.lang.Integer, it's OK.
Both of cases are worked well in java.