Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3.8, 2.4.0-rc-1, 2.4.1
-
None
-
Windows 7 64bit
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
Description
Testcase as follow:
import groovy.transform.CompileStatic import org.junit.Test class Bug1Base<T> { T t T get(a, b=0) { return t } } class Bug1 { @Test @CompileStatic void test() { Bug1Base<Integer> bug = new Bug1Base<Integer>(t:1) Integer t = bug.get(1) println t } }
It will cause type checking error as follow:
Groovyc: [Static type checking] - Cannot assign value of type T to variable of type java.lang.Integer