Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
None
-
None
-
None
-
windows xp
Description
After a declaration of a collection with generics, the wrong types are inserted and accepted, even if the generics are also explicitly declared in the constructor. Code to reproduce it:
Map<String, Integer> map = [:]
map["foo"] = "bar"
println "map = $map"
Map<String, Integer> map2 = new HashMap<String, Integer>()
map2.put("foo", "bar")
println "map2 = $map2"
Output:
map = [foo:bar]
map2 = [foo:bar]