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 transform of return statement fails #5314

Closed
scabug opened this issue Dec 14, 2011 · 4 comments
Closed

CPS transform of return statement fails #5314

scabug opened this issue Dec 14, 2011 · 4 comments
Assignees
Labels
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Dec 14, 2011

A simple return statement fails when CPS transformed. The same statement without CPS annotations works properly so the code structure itself is OK.

This form should be able to be transformed.

import scala.util.continuations._

object Test {

  def test1(): Int @cps[Int] = {
    return 1
  }

  def main(args: Array[String]): Any = {
    println(reset(test1()))
  }

}
$ ~/opt/scala-2.10.0.dev-1302-g6a33a20/bin/scala -P:continuations:enable returnX.scala
/p/scala/bugs/returnX.scala:8: error: type mismatch;
 found   : Int(1)
 required: Int @util.continuations.cps[Int]
    return 1
           ^
one error found
@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Dec 14, 2011

Imported From: https://issues.scala-lang.org/browse/SI-5314?orig=1
Reporter: @richdougherty
Affected Versions: 2.9.1, 2.10.0
Other Milestones: 2.10.0-M6, 2.10.0

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Dec 18, 2011

@richdougherty said:
Happens in typer phase before (I think) continuations plugin even gets a chance to run.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Sep 28, 2012

@scabug scabug closed this Sep 28, 2012
@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Nov 5, 2012

@adriaanm said:
fixed for 2.9.3 in scala/scala#1560

@scabug scabug added this to the 2.9.3-RC1 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.