diff options
author | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-08-17 16:57:36 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-08-17 16:57:36 +0200 |
commit | c61986d09e59f12eb612bfdf96cb7f6e7d0c27a7 (patch) | |
tree | dec468c24a22d56e52908592b9ccf0efa0193d91 /tests/run | |
parent | 3379bfe7efb7f59512e348099985fa58023f1d89 (diff) | |
download | dotty-c61986d09e59f12eb612bfdf96cb7f6e7d0c27a7.tar.gz dotty-c61986d09e59f12eb612bfdf96cb7f6e7d0c27a7.tar.bz2 dotty-c61986d09e59f12eb612bfdf96cb7f6e7d0c27a7.zip |
Test that partial functions are handled correctly.
Diffstat (limited to 'tests/run')
-rw-r--r-- | tests/run/partialFunctions.scala | 10 |
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) + } +} |