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

match statement with continuations causes "cps-transformed unexpectedly" warning and crash #6817

Closed
scabug opened this issue Dec 15, 2012 · 4 comments

Comments

@scabug
Copy link

scabug commented Dec 15, 2012

Mixing pattern matching and continuations causes an surprising warning in 2.10.0-RC5, though the code compiles fine in 2.9.2

$ /usr/local/scala-2.10.0-RC5/bin/scalac -P:continuations:enable bug1.scala
bug1.scala:7: warning: expression matchEnd6(x: Int){
x
} is cps-transformed unexpectedly
x match {
^
one warning found

When the case analysis appears in a catch statement, the warning becomes a compiler crash that has a lot to say about itself. I've attached the output of

$ /usr/local/scala-2.10.0-RC5/bin/scalac -P:continuations:enable bug2.scala

@scabug
Copy link
Author

scabug commented Dec 15, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6817?orig=1
Reporter: Topher (topher.the.geek)
Affected Versions: 2.10.0-RC5
Attachments:

  • bug1.scala (created on Dec 15, 2012 6:50:13 AM UTC, 243 bytes)
  • bug2.scala (created on Dec 15, 2012 6:50:13 AM UTC, 245 bytes)
  • out (created on Dec 15, 2012 6:50:13 AM UTC, 67735 bytes)

@scabug
Copy link
Author

scabug commented Jan 4, 2013

Ngoc Dao (ngocdaothanh) said:
I've also seen this warning:

[warn] /Users/ngoc/src/xitrum-demos/src/main/scala/demos/controller/BoringGreeter.scala:79: expression matchEnd7(x: String){
[warn] x
[warn] } is cps-transformed unexpectedly
[warn] params.get("Favorite book") match {
[warn] ^
[warn] one warning found

To reproduce it:
git clone git://github.com/ngocdaothanh/xitrum-demos.git
cd xitrum-demos
sbt/sbt run

@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).

@scabug scabug closed this as completed Feb 26, 2015
@scabug
Copy link
Author

scabug commented Aug 11, 2016

@SethTisue said:
there is now a GitHub issue at scala/scala-continuations#15

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

1 participant