summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-03-20 19:56:56 -0700
committerPaul Phillips <paulp@improving.org>2012-03-20 20:14:44 -0700
commit1c65152c7aaeb3aeaf8a5e39e6fd51e5b4b95836 (patch)
tree524485bfad496e5dbc1d5724d1da0993dfa6d8cd /src
parent6d7bcd5818b856d4596b57b7e9f1543b71ed7329 (diff)
downloadscala-1c65152c7aaeb3aeaf8a5e39e6fd51e5b4b95836.tar.gz
scala-1c65152c7aaeb3aeaf8a5e39e6fd51e5b4b95836.tar.bz2
scala-1c65152c7aaeb3aeaf8a5e39e6fd51e5b4b95836.zip
Fix for stability failure.
Pattern matcher! Totally unrelated to irrefutability, the pattern matcher at some point stopped sorting its lookup switch cases, and the butterfly's wings flapped enough to swap two cases. Now they're sorted in ascending order like they're supposed to be.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/matching/ParallelMatching.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
index 1285e29d4a..be5a9907b8 100644
--- a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
+++ b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
@@ -309,7 +309,7 @@ trait ParallelMatching extends ast.TreeDSL
}
lazy val cases =
- for ((tag, indices) <- literalMap.toList) yield {
+ for ((tag, indices) <- literalMap.toList.sortBy(_._1)) yield {
val newRows = indices map (i => addDefaultVars(i)(rest rows i))
val r = remake(newRows ++ defaultRows, includeScrut = false)
val r2 = make(r.tvars, r.rows map (x => x rebind bindVars(tag, x.subst)))