summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-05-21 03:27:40 +0000
committerPaul Phillips <paulp@improving.org>2010-05-21 03:27:40 +0000
commit1fa7a9373acb8aa79f8195ed38e1fb9f75c93768 (patch)
tree1e4e13094693acd49725bbb763449a5d751feb17
parentbb141f2c7d3a35e3a60c02b7385faf5c4adcad72 (diff)
downloadscala-1fa7a9373acb8aa79f8195ed38e1fb9f75c93768.tar.gz
scala-1fa7a9373acb8aa79f8195ed38e1fb9f75c93768.tar.bz2
scala-1fa7a9373acb8aa79f8195ed38e1fb9f75c93768.zip
A more specifically targetted version of r21991...
A more specifically targetted version of r21991 which ought to eliminate the pathological behavior displayed by files/run/Course-2002-07.scala under -optimise. No review.
-rw-r--r--src/compiler/scala/tools/nsc/matching/Patterns.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/matching/Patterns.scala b/src/compiler/scala/tools/nsc/matching/Patterns.scala
index 14e940d8a9..55d35bf884 100644
--- a/src/compiler/scala/tools/nsc/matching/Patterns.scala
+++ b/src/compiler/scala/tools/nsc/matching/Patterns.scala
@@ -325,9 +325,9 @@ trait Patterns extends ast.TreeDSL {
}
def unapply(x: UnApply) = condOpt(x) {
case UnApply(Apply(TypeApp(tptArg), _), List(ArrayValue(_, xs)))
- // make sure it's not empty or only _*, as otherwise the rewrite
+ // make sure it's not only _*, as otherwise the rewrite
// also removes the instance check.
- if xs takeWhile (x => !isStar(x)) nonEmpty => (tptArg, xs)
+ if (xs.isEmpty || xs.size > 1 || !isStar(xs.head)) => (tptArg, xs)
}
}