aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/Patterns.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pos/Patterns.scala')
-rw-r--r--tests/pos/Patterns.scala19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/pos/Patterns.scala b/tests/pos/Patterns.scala
new file mode 100644
index 000000000..1161e352b
--- /dev/null
+++ b/tests/pos/Patterns.scala
@@ -0,0 +1,19 @@
+object Patterns {
+ ('1', "1") match {
+ case (digit, str) => true
+ case _ => false
+ }
+
+ val xs = List('2' -> "ABC", '3' -> "DEF")
+
+ xs filter {
+ case (digit, str) => true
+ case _ => false
+ }
+
+ def sum(xs: List[Int]): Int = xs match {
+ case Nil => 0
+ case x :: xs1 => x + sum(xs1)
+ }
+
+} \ No newline at end of file