diff options
author | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-09-09 15:18:00 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-09-17 18:07:16 +0200 |
commit | 7a74d71202f514e5d5b79b8e393bd564dff5f0a2 (patch) | |
tree | da22c6fc1b3aa9ab46278143f73eb56e68678099 /tests/pos | |
parent | 1287f2dd2d0af03c215951b4264d1c627731cea8 (diff) | |
download | dotty-7a74d71202f514e5d5b79b8e393bd564dff5f0a2.tar.gz dotty-7a74d71202f514e5d5b79b8e393bd564dff5f0a2.tar.bz2 dotty-7a74d71202f514e5d5b79b8e393bd564dff5f0a2.zip |
More complicated patterns.
Diffstat (limited to 'tests/pos')
-rw-r--r-- | tests/pos/Patterns.scala | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/pos/Patterns.scala b/tests/pos/Patterns.scala index f601b95a8..f7994a093 100644 --- a/tests/pos/Patterns.scala +++ b/tests/pos/Patterns.scala @@ -4,6 +4,30 @@ object Patterns {/* case _ => false } + object Breakdown { + def unapplySeq(x: Int): Some[List[String]] = Some(List("", "there")) + } + + object Test2 { + 42 match { + case Breakdown("") => // needed to trigger bug + case Breakdown("foo") => // needed to trigger bug + case Breakdown("", who) => println ("hello " + who) + } + } + + val names = List("a", "b", "c") + object SeqExtractors { + val y = names match { + case List(x, z) => x + case List(x) => x + case List() => "" + } + val yy: String = y + } + + + val xs = List('2' -> "ABC", '3' -> "DEF") xs filter { |