diff options
author | Burak Emir <emir@epfl.ch> | 2008-01-15 23:18:08 +0000 |
---|---|---|
committer | Burak Emir <emir@epfl.ch> | 2008-01-15 23:18:08 +0000 |
commit | 078b5982346c1295706d24c2404854b3837043a1 (patch) | |
tree | d7bca6bdd02a090664b941d34e3e5f5f600005d3 | |
parent | 5d32ba1ca5bd9a0393f9b77f7204b26683638e1a (diff) | |
download | scala-078b5982346c1295706d24c2404854b3837043a1.tar.gz scala-078b5982346c1295706d24c2404854b3837043a1.tar.bz2 scala-078b5982346c1295706d24c2404854b3837043a1.zip |
fixed t341
-rw-r--r-- | src/compiler/scala/tools/nsc/matching/ParallelMatching.scala | 2 | ||||
-rw-r--r-- | test/files/run/patmatnew.scala | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala index ca3eef96a0..d019b4cc89 100644 --- a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala +++ b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala @@ -541,7 +541,7 @@ trait ParallelMatching { ys = ys.tail } val tail = newVar(scrutinee.pos, sequenceType) - bindings += typedValDef(tail, {if (ix-1>0) seqDrop(treeAsSeq.duplicate, ix) else mkIdent(scrutinee)}) + bindings += typedValDef(tail, {if (ix > 0) seqDrop(treeAsSeq.duplicate, ix) else mkIdent(scrutinee)}) val nrows = new ListBuffer[Row] diff --git a/test/files/run/patmatnew.scala b/test/files/run/patmatnew.scala index 3580e561e8..77727060da 100644 --- a/test/files/run/patmatnew.scala +++ b/test/files/run/patmatnew.scala @@ -165,11 +165,16 @@ object Test extends TestConsoleMain { def doMatch(xs: List[String]): String = xs match { case List(_*) => "ok" } + def doMatch2(xs: List[String]): List[String] = xs match { + case List(_, rest @ _*) => rest.toList + } override def runTest() { val list1 = List() assertEquals(doMatch(list1), "ok") val list2 = List("1","2","3") assertEquals(doMatch(list2), "ok") + val list3 = List("1","2","3") + assertEquals(doMatch2(list3), List("2","3")) } } |