Scala Programming Language
  1. Scala Programming Language
  2. SI-6817

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

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: Scala 2.10.0-RC5
    • Fix Version/s: None
    • Labels:
      None

      Description

      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

      1. bug1.scala
        0.2 kB
        Topher
      2. bug2.scala
        0.2 kB
        Topher
      3. out
        66 kB
        Topher

        Activity

        Hide
        Ngoc Dao added a comment -

        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

        Show
        Ngoc Dao added a comment - 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

          People

          • Assignee:
            Adriaan Moors
            Reporter:
            Topher
          • Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:

              Development