diff options
author | Martin Odersky <odersky@gmail.com> | 2013-11-09 19:00:14 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-11-09 19:00:14 +0100 |
commit | a7b60116c30677eeff310b81af2fa714bf1950d6 (patch) | |
tree | 40de9fd78f40b0adfc6d2600b4f60f5b7721519b /tests/pos/Patterns.scala | |
parent | 3bc8f5dceba014ddd0c7e5cc8080009439c5b363 (diff) | |
download | dotty-a7b60116c30677eeff310b81af2fa714bf1950d6.tar.gz dotty-a7b60116c30677eeff310b81af2fa714bf1950d6.tar.bz2 dotty-a7b60116c30677eeff310b81af2fa714bf1950d6.zip |
New tests.
Diffstat (limited to 'tests/pos/Patterns.scala')
-rw-r--r-- | tests/pos/Patterns.scala | 19 |
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 |