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

Map<String,Integer> is recognized as Map<String,String> by the type checker

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.0-beta-2
    • 2.0-beta-3
    • Static Type Checker
    • None

    Description

      The following code fails:

      Map<String,Integer> foo = new HashMap<String,Integer>()
      foo.put('foo', 1)
      

      because the type checker aligns the V placeholder in <K,V> with String instead of Integer.

      Attachments

        Activity

          People

            melix Cédric Champeau
            melix Cédric Champeau
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: