Uploaded image for project: 'Scala Programming Language'
  1. Scala Programming Language
  2. SI-7407

return inside try + pattern-match inside finally causes VerifyError

    Details

    • Type: Bug
    • Status: CLOSED
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Scala 2.10.1
    • Fix Version/s: Scala 2.12.0-M1
    • Component/s: Compiler Backend
    • Labels:
      None

      Description

      When upgrading to 2.9.2. to 2.10.1, ran into this.
      Minimal test case:

      def foo: String = try return "Hello" finally 10 match {case x => ()}
      

      throws

      java.lang.VerifyError: (class: , method: foo signature: ()Ljava/lang/String;) Inconsistent stack height 0 != 1
      

      when accessed.

      Seems to be the combination of return in the try and the pattern match in the finally that does it.

      Looks like James Iry blogged about something related, recently:
      http://james-iry.blogspot.com/2013/01/scala-trycatch-lifting-proposal.html

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rytz Lukas Rytz
                Reporter:
                pdxleif Leif Warner
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: