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

exception in phase 'class generation' using getAt()

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.1
    • Fix Version/s: 2.2.2
    • Component/s: Static compilation
    • Labels:
      None
    • Environment:
      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

            • Assignee:
              melix C├ędric Champeau
              Reporter:
              ataylor284 Andrew Taylor
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: