summaryrefslogtreecommitdiff
path: root/test/files/continuations-run/trycatch0.scala
blob: 74a078b5ef13787dc94383fea7dfe30f5d8d9b7e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// $Id$

import scala.util.continuations._

object Test {

  def foo = try {
    shift((k: Int=>Int) => k(7))
  } catch {
    case ex =>
      9
  }

  def bar = try {
    7
  } catch {
    case ex =>
    shiftUnit0[Int,Int](9)
  }

  def main(args: Array[String]): Unit = {
    println(reset { foo + 3 })
    println(reset { bar + 3 })
  }
}