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

'class generation' bug when CompileStatic with HashMap and List

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.6
    • 2.1.7, 2.2.0-beta-2
    • Static compilation
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: