aboutsummaryrefslogtreecommitdiff
path: root/tests/run/emptypf.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run/emptypf.scala')
-rw-r--r--tests/run/emptypf.scala14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/run/emptypf.scala b/tests/run/emptypf.scala
new file mode 100644
index 000000000..eb3e3e638
--- /dev/null
+++ b/tests/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")
+ }
+}