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

exception in phase 'class generation' using getAt()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.2.1
    • 2.2.2
    • Static compilation
    • None
    • groovy 2.2.1, Oracle JVM: 1.7.0_51 on Linux

    Description

      Compiling the testcase generates the following error message:

      BUG! exception in phase 'class generation' in source unit '/home/ataylor/dev/groovybug/testcase.groovy' At line 13 column 23

      The test case:

          class Foo {
              String getAt(int i) {
                  "0"
              }
          }
          @groovy.transform.CompileStatic
          class Bar {
              def bug() {
                  def foo = new Foo()
                  def bar = ["bar"]
      
                  for (i in 1..2) {
                      bar[i] = foo[i]
                  }
              }
          }
      

      Attachments

        Activity

          People

            melix Cédric Champeau
            ataylor284 Andrew Taylor
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: