Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.5.14
-
None
Description
We noticed a change in behavior moving from Groovy 2.4.x to 2.5.x,
and wondering if it was an expected change. It seems to be a difference with the compiler
We use groovy-eclipse-batch.
This is a contrived example, but based on an issue we had in PROD
List<Integer> myList = [1,2,3] myList.each { Integer -> println Integer.xxx}
With groovy-eclipse-batch 2.4.17-01 (and groovy 2.4.15) we get errors saying:
No such property: xxx for class: java.lang.Integer
However, using groovy-eclipse-batch 2.5.14-02 and Groovy 2.5.14, it prints out the full class name of the Integer class
From this Slack thread: If you look in the AST browser, after conversion phase we have:
public java.lang.Object run() { List<Integer> myList = [1, 2, 3] myList.each({ java.lang.Object Integer -> this.println( Integer .xxx) }) }
By end of semantic analysis phase we have:
public java.lang.Object run() { List<Integer> myList = [1, 2, 3] myList.each({ java.lang.Object Integer -> this.println( java.lang.Integer) }) }