Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPS + try/catch regression in 2.9.x branch #6384

Closed
scabug opened this issue Sep 17, 2012 · 3 comments
Closed

CPS + try/catch regression in 2.9.x branch #6384

scabug opened this issue Sep 17, 2012 · 3 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Sep 17, 2012

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)
    }
  }
}
@scabug
Copy link
Author

scabug commented Sep 17, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6384?orig=1
Reporter: @phaller
Affected Versions: 2.9.2

@scabug
Copy link
Author

scabug commented Sep 18, 2012

@phaller said (edited on Sep 19, 2012 12:13:35 PM UTC):
I submitted a pull request which fixes the issue:
scala/scala#1334

@scabug
Copy link
Author

scabug commented Sep 18, 2012

@phaller said:
Changing priority to critical since it's a regression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants