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

I expect Nothing casts to cps type automatically, but it doesn't. #5180

Closed
scabug opened this issue Nov 11, 2011 · 3 comments
Closed

I expect Nothing casts to cps type automatically, but it doesn't. #5180

scabug opened this issue Nov 11, 2011 · 3 comments

Comments

@scabug
Copy link

scabug commented Nov 11, 2011

object Foo {
  import scala.util.continuations._
  def throwException():Unit @suspendable =
    throw new Exception

  // OK!
  def f1() = {
    val a = 5
    if (a != 3) {
      throwException()
    } else {
      shiftUnit0[Unit, Unit]()
    }
  }

  // Error!
  def f2() = {
    val a = 5
    if (a != 3) {
      throw new Exception
    } else {
      shiftUnit0[Unit, Unit]()
    }
  }
}
<console>:28: error: then and else parts must both be cps code or neither of them
           if (a != 3) {
           ^
@scabug
Copy link
Author

scabug commented Nov 11, 2011

Imported From: https://issues.scala-lang.org/browse/SI-5180?orig=1
Reporter: @Atry
Affected Versions: 2.9.1

@scabug
Copy link
Author

scabug commented Nov 11, 2011

@Atry said:
Nothing should be able to cast to any type automatically, include cps types.

@scabug
Copy link
Author

scabug commented Feb 26, 2015

@adriaanm said:
Sorry, the continuations plugin has been unsupported for a while now. Please open an issue over at https://github.com/scala/scala-continuations (we're still looking for a maintainer for it, though).

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