summaryrefslogtreecommitdiff
path: root/test/files/pos/simple-exceptions.scala
blob: a9f16bf90b4066a7013db22a25b1eeac65836518 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import java.io.IOException;

object Test {

  //def error[a](x: String):a = new java.lang.RuntimeException(x) throw;

  def main(args: Array[String]): Unit = {
    try {
      try {
	      Console.println("hi!")
        sys.error("xx")
      }
      finally Console.println("ho!")
    }
    catch {
      case ex: IOException => Console.println("io exception!");
      case ex              => Console.println(ex);
    }
  }
}