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