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

'class generation' bug when CompileStatic with HashMap and List

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.6
    • Fix Version/s: 2.1.7, 2.2.0-beta-2
    • Component/s: Static compilation
    • Labels:
      None
    • Environment:
      Windows 2003

      Description

      The test.groovy code below throws

      Caught: BUG! exception in phase 'class generation' in source unit 'test.groovy' At line 7 column 13
      On receiver: AR.key with message: getAt and arguments: 0
      
      @groovy.transform.CompileStatic 
      class MyClass{
        HashMap<String,List<List>> AR=new HashMap<String,List<List>>()
        
        MyClass(){
          AR.get('key',[['val1'],['val2']])
          println AR.'key'[0]
        }
      }
      
      MyClass c=new MyClass()
      

        Attachments

          Activity

            People

            • Assignee:
              blackdrag Jochen Theodorou
              Reporter:
              radim.vachtl Radim Vachtl
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: