summaryrefslogtreecommitdiff
path: root/test/files/continuations-neg/t5314-type-error.scala
blob: e36ce6c203a419313a6160fd8574e2d3407de3f5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import scala.util.continuations._

object Test extends App {
  def foo(x:Int): Int @cps[Int] = shift { k => k(x) }

  // should be a type error
  def bar(x:Int): Int @cps[String] = return foo(x)

  def caller(): Unit = {
    val v: String = reset {
      val res: Int = bar(8)
      "hello"
    }
  }

  caller()
}