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

VerifyError when CompileStatic with Increment Array Element

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.1
    • 2.0.2
    • Static compilation
    • None
    • Groovy 2.0.1, java version "1.7.0_05", MacOSX 10.8

    Description

      I found errors when I use increment(prefix/postfix) operator to an element of array.
      Following Code:

      import groovy.transform.*
      
      @CompileStatic
      def foo()
      {
        int[] p = new int[10]
        p[0]++
      }
      
      foo()
      
      

      generates following error:

      $ /tool/groovy-2.0.1/target/install/bin/groovy ~/tmp/test2.groovy
      Caught: java.lang.VerifyError: (class: test2, method: foo signature: ()Ljava/lang/Object Expecting to find array of objects or arrays on stack
      java.lang.VerifyError: (class: test2, method: foo signature: ()Ljava/lang/Object Expecting to find array of objects or arrays on stack

      Attachments

        Activity

          People

            melix Cédric Champeau
            uehaj UEHARA Junji
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: