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

VerifyError in generated class data

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-JSR-6
    • 1.0-RC-1
    • class generator
    • None
    • Win-XP, Sun JDK 1.4 .2_05

    Description

      I tried to define this method in groovy:

      public lsum( elems ) {
      sum = 0
      for (i in elems)

      { sum += i }

      return sum
      }

      elems = []
      for (i in 0..999) {
      elems.add
      }

      result = lsum(elems)

      But executing this in GroovyConsole generated the following error:

      Exception thrown: java.lang.VerifyError:
      (class: Script0, method: lsum signature: (Ljava/lang/Object;)Ljava/lang/Object
      Inconsistent stack height 4 != 2

      As a result, this code would not even run.

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            mdejong Mo DeJong
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: