summaryrefslogtreecommitdiff
path: root/test/disabled/pos/t1545.scala
blob: 4c5908b8a104bda0e61e9aab4ec68f4e02f9b5eb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// According to the spec this code should not be legal.
// Disabling for now.
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
        
}