summaryrefslogtreecommitdiff
path: root/test/pos/partialfun.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/pos/partialfun.scala')
-rw-r--r--test/pos/partialfun.scala10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/pos/partialfun.scala b/test/pos/partialfun.scala
new file mode 100644
index 0000000000..57efb1d2ea
--- /dev/null
+++ b/test/pos/partialfun.scala
@@ -0,0 +1,10 @@
+module partialfun {
+
+ def applyPartial[b](f: PartialFunction[Option[String], b])(x: Option[String]) =
+ if (f.isDefinedAt(x)) f(x) else "<undefined>";
+
+ applyPartial {
+ case Some(x) => x
+ } (None());
+
+} \ No newline at end of file