Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
2.1.1
-
Windows 7 64 bit, JDK 1.7.0_10
Description
The code below compiled successfully in 2.0.5
in 2.1.1 we got compile error message:
Groovyc: [Static type checking] - Cannot assign value of type java.lang.Object to variable of type CTypeTest
class CTypeTest { @CompileStatic public static void test1(String[] args) { // Cannot assign value of type java.lang.Object to variable of type CTypeTest CTypeTest s1 = cache { return new CTypeTest(); } } @CompileStatic static <T> T cache(Closure<T> closure) { return closure.call(); } }
Of-course this prevents us from upgrading to 2.1.1 (and using full indy feature)
Thanks
Boaz