From 19fad7a34125f975a7832d125b9868500546af7a Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Sun, 5 Mar 2017 21:13:28 +0900 Subject: Remove uses of Collections from scala-reflect --- compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala') diff --git a/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala b/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala index 7c49e68dd..7576ccc05 100644 --- a/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala +++ b/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala @@ -30,8 +30,6 @@ import dotty.tools.dotc.util.Positions.Position import dotty.tools.dotc.core.Decorators._ import dotty.tools.dotc.core.Flags -import scala.reflect.internal.util.Collections - /** This transform eliminates patterns. Right now it's a dummy. * Awaiting the real pattern matcher. * elimRepeated is required @@ -166,7 +164,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer { } def emitValDefs: List[ValDef] = { - Collections.map2(lhs, rhs)((symbol, tree) => ValDef(symbol.asTerm, tree.ensureConforms(symbol.info))) + (lhs, rhs).zipped.map((symbol, tree) => ValDef(symbol.asTerm, tree.ensureConforms(symbol.info))) } } object NoRebindings extends Rebindings(Nil, Nil) @@ -609,7 +607,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer { // only store binders actually used val (subPatBindersStored, subPatRefsStored) = stored.filter{case (b, _) => usedBinders(b)}.unzip - Block(Collections.map2(subPatBindersStored.toList, subPatRefsStored.toList)((bind, ref) => { + Block((subPatBindersStored.toList, subPatRefsStored.toList).zipped.map((bind, ref) => { // required in case original pattern had a more precise type // eg case s@"foo" => would be otherwise translated to s with type String instead of String("foo") def refTpeWiden = ref.tpe.widen -- cgit v1.2.3