Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.2.0-beta-2
-
None
-
Tested on Windows and Mac Os with Java 1.7
Description
The following script causes a compilation error since Groovy 2.2.
The error occurs as soon as you start putting 'mixed' types in the Maps (e.g. Integer and String). I checked it again in Groovy 2.1.3 and it compiled fine.
import groovy.transform.TypeChecked @TypeChecked def myFunction() { Map mapA=[e:1,et:'Error',ev:'Hello'] Map mapB=[e:0,et:'No Error',ev:'World'] mapB.e=mapA.e // causes compilation error: [Static type checking] - Incompatible generic argument types. Cannot assign java.io.Serializable <? extends java.io.Serializable> to: java.io.Serializable <? extends java.io.Serializable> println "${mapB.e}" } myFunction()