diff options
author | Paul Phillips <paulp@improving.org> | 2009-11-20 20:37:12 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-11-20 20:37:12 +0000 |
commit | 937872a48956c11c278839622d5514a3ed65e25d (patch) | |
tree | 55f3b40281e9fa9236e2b922d961bc294cfff36d /src/compiler | |
parent | 06947d66eacd74a4c12aab2b3b3f3d4a8552ff88 (diff) | |
download | scala-937872a48956c11c278839622d5514a3ed65e25d.tar.gz scala-937872a48956c11c278839622d5514a3ed65e25d.tar.bz2 scala-937872a48956c11c278839622d5514a3ed65e25d.zip |
Expanding the warning cleansing into -unchecked...
Expanding the warning cleansing into -unchecked territory.
Diffstat (limited to 'src/compiler')
3 files changed, 15 insertions, 8 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)) |