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

try-finally block creates a VerifyError when used in methods with return values

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 1.0
    • 1.1-beta-1
    • None
    • None
    • Ubuntu Linux 6.10, Java SE 6, Groovy 1.0

    Description

      When using a try-finally block in methods with return values then it creates a VerifyError on execution. The following script creates this output:

      boolean foo () {
      try

      { print "try" return true }

      finally

      { print "finally" }

      }

      foo ()

      Output: eddie@saringnb:~$ groovy test.groovy
      Caught: java.lang.VerifyError: (class: test, method: foo signature: ()Z) Expecting to find object/array on stack

      The problem doesn't exists when foo would return void.

      Thanks in advance,
      Stefan

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            jede Stefan Saring
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: