aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2015-08-17 16:57:36 +0200
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2015-08-17 16:57:36 +0200
commitc61986d09e59f12eb612bfdf96cb7f6e7d0c27a7 (patch)
treedec468c24a22d56e52908592b9ccf0efa0193d91 /tests
parent3379bfe7efb7f59512e348099985fa58023f1d89 (diff)
downloaddotty-c61986d09e59f12eb612bfdf96cb7f6e7d0c27a7.tar.gz
dotty-c61986d09e59f12eb612bfdf96cb7f6e7d0c27a7.tar.bz2
dotty-c61986d09e59f12eb612bfdf96cb7f6e7d0c27a7.zip
Test that partial functions are handled correctly.
Diffstat (limited to 'tests')
-rw-r--r--tests/run/partialFunctions.scala10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/run/partialFunctions.scala b/tests/run/partialFunctions.scala
new file mode 100644
index 000000000..ca82431ca
--- /dev/null
+++ b/tests/run/partialFunctions.scala
@@ -0,0 +1,10 @@
+object Test {
+
+ def takesPartialFunction(a: PartialFunction[Int, Int]) = a(1)
+
+ def main(args: Array[String]): Unit = {
+ val partialFunction: PartialFunction[Int, Int] = {case a: Int => a}
+
+ assert(takesPartialFunction(partialFunction) == 1)
+ }
+}