aboutsummaryrefslogtreecommitdiff
path: root/tests/run/patmat-finally.scala
blob: 895fb79f79dee3b6c60e912f372c2d2850ceb028 (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
/** Test pattern matching and finally, see SI-5929. */
object Test extends dotty.runtime.LegacyApp {
  def bar(s1: Object, s2: Object): Unit = {
    s1 match {
      case _ =>
    }

    try {
      ()
    } finally {
      s2 match {
        case _ =>
      }
    }
  }

  def x = {
    null match { case _ => }

    try { 1 } finally { while(false) { } }
  }

  bar(null, null)
  x
}