diff options
Diffstat (limited to 'test/disabled')
-rwxr-xr-x | test/disabled/pos/t1545.scala | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/disabled/pos/t1545.scala b/test/disabled/pos/t1545.scala new file mode 100755 index 0000000000..4c5908b8a1 --- /dev/null +++ b/test/disabled/pos/t1545.scala @@ -0,0 +1,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 + +} |