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[Nothing] cause compiler error. The same code replaced to other type is OK. #5170

Closed
scabug opened this issue Nov 9, 2011 · 2 comments
Closed

Comments

@scabug
Copy link

scabug commented Nov 9, 2011

  // OK!
  def f1(n:Int):Int @cps[Unit] = {
    shiftUnit0[Int, Unit](3)
  }
  
  
  // OK!
  def f2(n:Int):Unit @cps[Unit] = {
    val m = f1(n)
    shiftUnit0[Unit, Unit]()
  }
  
  // OK!
  def f5(n:Int):Int @cps[String] = {
    shiftUnit0[Int, String](3)
  }
  
  // OK!
  def f6(n:Int):Unit @cps[String] = {
    val m = f5(n)
    shiftUnit0[Unit, String]()
  }
  
  // OK!
  def f3(n:Int):Int @cps[Nothing] = {
    shiftUnit0[Int, Nothing](3)
  }
  
  /*
  <console>:12: error: type mismatch;
 found   : Int => scala.util.continuations.ControlContext[Unit,Nothing,Nothing]
 required: Int => scala.util.continuations.ControlContext[Unit,B1,Nothing]
           val m = f3(n)
               ^
   */
  def f4(n:Int):Unit @cps[Nothing] = {
    val m = f3(n)
    shiftUnit0[Unit, Nothing]()
    
  }

What the hell is B1?

@scabug
Copy link
Author

scabug commented Nov 9, 2011

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

@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