diff options
6 files changed, 27 insertions, 17 deletions
diff --git a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala index acd8130314..5a705c6748 100644 --- a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala +++ b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala @@ -511,8 +511,11 @@ trait ParallelMatching extends ast.TreeDSL case class Yes(bx: Int, moreSpecific: Pattern, subsumed: List[Pattern]) case class No(bx: Int, remaining: Pattern) - val (yeses, noes) : (List[Yes], List[No]) = - (for ((pattern, j) <- pmatch.pzip()) yield { + val (yeses, noes) = { + val _ys = new ListBuffer[Yes] + val _ns = new ListBuffer[No] + + for ((pattern, j) <- pmatch.pzip()) { // scrutinee, head of pattern group val (s, p) = (pattern.tpe, head.necessaryType) @@ -530,7 +533,7 @@ trait ParallelMatching extends ast.TreeDSL def typed(pp: Tree) = passl(ifEquiv(Pattern(pp))) def subs() = passl(ifEquiv(NoPattern), pattern subpatterns pmatch) - (pattern match { + val (oneY, oneN) = pattern match { case Pattern(LIT(null), _) if !(p =:= s) => (None, passr) // (1) case x if isObjectTest => (passl(), None) // (2) case Pattern(Typed(pp, _), _) if sMatchesP => (typed(pp), None) // (4) @@ -538,8 +541,12 @@ trait ParallelMatching extends ast.TreeDSL case x if !x.isDefault && sMatchesP => (subs(), None) case x if x.isDefault || pMatchesS => (passl(), passr) case _ => (None, passr) - }) : (Option[Yes], Option[No]) - }).unzip match { case (x,y) => (x.flatten, y.flatten) } + } + oneY map (_ys +=) + oneN map (_ns +=) + } + (_ys.toList, _ns.toList) + } val moreSpecific = yeses map (_.moreSpecific) val subsumed = yeses map (x => (x.bx, x.subsumed)) diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala index 78d83ff15d..fb5e24b23d 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala @@ -627,9 +627,9 @@ abstract class Pickler extends SubComponent { args foreach writeClassfileAnnotArg ANNOTARGARRAY - case (target: Symbol, children: List[Symbol]) => + case (target: Symbol, children: List[_]) => writeRef(target) - writeRefs(children) + writeRefs(children.asInstanceOf[List[Symbol]]) CHILDREN case EmptyTree => diff --git a/src/compiler/scala/tools/nsc/util/ClassPath.scala b/src/compiler/scala/tools/nsc/util/ClassPath.scala index aab74d8c02..cb48e432cd 100644 --- a/src/compiler/scala/tools/nsc/util/ClassPath.scala +++ b/src/compiler/scala/tools/nsc/util/ClassPath.scala @@ -308,7 +308,7 @@ abstract class MergedClassPath[T] extends ClassPath[T] { def sourcepaths: List[AbstractFile] = entries.flatMap(_.sourcepaths) private def addPackage(to: ClassPath[T], pkg: ClassPath[T]) = to match { - case cp: MergedClassPath[T] => + case cp: MergedClassPath[_] => newMergedClassPath(cp.entries ::: List(pkg)) case _ => newMergedClassPath(List(to, pkg)) diff --git a/src/library/scala/collection/SetLike.scala b/src/library/scala/collection/SetLike.scala index 0752f4185f..401c272516 100644 --- a/src/library/scala/collection/SetLike.scala +++ b/src/library/scala/collection/SetLike.scala @@ -176,7 +176,7 @@ self => * contain the same elements. */ override def equals(that: Any): Boolean = that match { - case that: Set[A] => + case that: Set[_] => (this eq that) || (that canEqual this) && (this.size == that.size) && diff --git a/src/library/scala/xml/include/sax/Main.scala b/src/library/scala/xml/include/sax/Main.scala index 4df95d1046..405fc670e5 100644 --- a/src/library/scala/xml/include/sax/Main.scala +++ b/src/library/scala/xml/include/sax/Main.scala @@ -47,13 +47,15 @@ object Main { if (args.isEmpty) return - val (resolver, args2): (Option[EntityResolver], Array[String]) = - if (args.size < 2 || args(0) != "-r") (None, args) + def dashR = args.size >= 2 && args(0) == "-r" + val args2 = if (dashR) args drop 2 else args + val resolver: Option[EntityResolver] = + if (dashR) None else catching(classOf[Exception]) opt { - val r = Class.forName(args(1)).newInstance().asInstanceOf[EntityResolver] - parser setEntityResolver r - (r, args drop 2) - } orElse (return error("Could not load requested EntityResolver")) + val r = Class.forName(args(1)).newInstance().asInstanceOf[EntityResolver] + parser setEntityResolver r + r + } orElse (return error("Could not load requested EntityResolver")) for (arg <- args2) { try { diff --git a/src/partest/scala/tools/partest/PartestTask.scala b/src/partest/scala/tools/partest/PartestTask.scala index 28dd00b408..64d48156db 100644 --- a/src/partest/scala/tools/partest/PartestTask.scala +++ b/src/partest/scala/tools/partest/PartestTask.scala @@ -234,8 +234,9 @@ class PartestTask extends Task { } } - val (allSuccesses, allFailures): (Int, Int) = - (testFileSets map runSet).foldLeft((0, 0))((sums, x) => (sums._1 + x._1, sums._2 + x._2)) + val _results = testFileSets map runSet + val allSuccesses = _results map (_._1) sum + val allFailures = _results map (_._2) sum def f = if (errorOnFailed && allFailures > 0) error(_) else log(_: String) def s = if (allFailures > 1) "s" else "" |