summaryrefslogtreecommitdiff
path: root/test/files/run/spec-nlreturn.scala
blob: 5ab1747856d8145574e91cc15eb81520e9afe5d5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
object Test {
  def f(): Int = {
    try {
      val g = (1 to 10 map { i => return 16 ; i }).sum
      g
    }
    catch { case x: runtime.NonLocalReturnControl[_] =>
      println(x.getClass.getName)
      x.value.asInstanceOf[Int]
    }
  }

  def main(args: Array[String]): Unit = {
    println(f())
  }
}