diff options
Diffstat (limited to 'tests/run/partialFunctions.scala')
-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) + } +} |