Scala Programming Language
  1. Scala Programming Language
  2. SI-6384

CPS + try/catch regression in 2.9.x branch

    Details

      Description

      The following code crashes the compiler under recent 2.9.x nightlies (tested with nightly IDE releases from 6/30 and 8/10), but works with 2.9.2 and 2.10.0-M5:

      package foo
      
      import scala.util.continuations._
      
      trait Result
      case class ValueResult(value: Int) extends Result
      case class ErrorResult(err: Exception) extends Result
      
      class Foo {
        def func: Int @cpsParam[Any, Any] = shiftUnit(5)
      }
      
      object Bar {
        val foo = new Foo
        def f: Result @cpsParam[Any, Any] = {
          try { ValueResult(foo.func) }
          catch {
            case ex: Exception => ErrorResult(ex)
          }
        }
      }
      

        Activity

        Hide
        Philipp Haller added a comment - - edited

        I submitted a pull request which fixes the issue:
        https://github.com/scala/scala/pull/1334

        Show
        Philipp Haller added a comment - - edited I submitted a pull request which fixes the issue: https://github.com/scala/scala/pull/1334
        Hide
        Philipp Haller added a comment -

        Changing priority to critical since it's a regression.

        Show
        Philipp Haller added a comment - Changing priority to critical since it's a regression.

          People

          • Assignee:
            Philipp Haller
            Reporter:
            Philipp Haller
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development