Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-3903

Generics ignored

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • None
    • 1.6.3
    • 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]

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            peninha peninha
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: