Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.4.4, 2.4.5
-
None
-
None
Description
In the code below. When refer to time without the "it" prefix. The compiler get type of "time" wrongly. "time" is Date but it determined as long.
@CompileStatic class GMain { static void main(String[] args) { Calendar.instance.with { println time.class<span class="code-comment">//This print java.util.Date which is OK Date d1 = time//This line failed to compile with error Groovyc: [Static type checking] - Cannot assign value of type long to variable of type java.util.Date Date d2 = it.time//This line is OK } } }