summaryrefslogtreecommitdiff
path: root/test/files/pos/t1545.scala
blob: 51df606da3264e7b0cd3a8df10dd1c0370e93539 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
object Main extends App {

    case class Foo (field : Option[String])

    val x : PartialFunction[Foo,Int] =
        {
            c => c.field match {
                case Some (s) => 42
                case None     => 99
            }
        }
        
    println (x (Foo (None))) // prints 99
    println (x (Foo (Some ("foo")))) // prints 42
        
}