diff options
Diffstat (limited to 'test/files/run/emptypf.scala')
-rw-r--r-- | test/files/run/emptypf.scala | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/files/run/emptypf.scala b/test/files/run/emptypf.scala new file mode 100644 index 0000000000..eb3e3e6380 --- /dev/null +++ b/test/files/run/emptypf.scala @@ -0,0 +1,14 @@ +object Test { + val f: PartialFunction[String, Int] = { + PartialFunction.empty[String, Int] orElse { + case "abc" => 100 + case s => s.length + } + } + + def main(args: Array[String]): Unit = { + println(f("abc")) + println(f("def")) + println(PartialFunction.empty[String, Int] isDefinedAt "abc") + } +} |