diff --git a/core/src/main/scala/scala/collection/generic/ParFactory.scala b/core/src/main/scala/scala/collection/generic/ParFactory.scala index 438bc469..56a2fadd 100644 --- a/core/src/main/scala/scala/collection/generic/ParFactory.scala +++ b/core/src/main/scala/scala/collection/generic/ParFactory.scala @@ -39,7 +39,7 @@ extends GenericParCompanion[CC] { def concat[A](xss: Iterable[A]*): CC[A] = { val b = newBuilder[A] // At present we're using IndexedSeq as a proxy for "has a cheap size method". - if (xss forall (_.isInstanceOf[IndexedSeq[_]])) + if (xss forall (_.isInstanceOf[IndexedSeq[?]])) b.sizeHint(xss.map(_.size).sum) for (xs <- xss) b ++= xs diff --git a/core/src/main/scala/scala/collection/generic/ParSetFactory.scala b/core/src/main/scala/scala/collection/generic/ParSetFactory.scala index bae890ef..89dfa7b3 100644 --- a/core/src/main/scala/scala/collection/generic/ParSetFactory.scala +++ b/core/src/main/scala/scala/collection/generic/ParSetFactory.scala @@ -22,7 +22,7 @@ import scala.collection.parallel.ParSetLike * @define factoryInfo * This object provides a set of operations needed to create `$Coll` values. */ -abstract class ParSetFactory[CC[X] <: ParSet[X] with ParSetLike[X, CC, CC[X], _] with GenericParTemplate[X, CC]] +abstract class ParSetFactory[CC[X] <: ParSet[X] with ParSetLike[X, CC, CC[X], ?] with GenericParTemplate[X, CC]] extends GenericParCompanion[CC] { def newBuilder[A]: Combiner[A, CC[A]] = newCombiner[A] diff --git a/core/src/main/scala/scala/collection/immutable/OldHashMap.scala b/core/src/main/scala/scala/collection/immutable/OldHashMap.scala index 3dd253cd..46b6ff60 100644 --- a/core/src/main/scala/scala/collection/immutable/OldHashMap.scala +++ b/core/src/main/scala/scala/collection/immutable/OldHashMap.scala @@ -423,13 +423,13 @@ object OldHashMap extends MapFactory[OldHashMap] { val sizeNew = size - sub.size // if we have only one child, which is not a HashTrieSet but a self-contained set like // HashSet1 or HashSetCollision1, return the child instead - if (elemsNew.length == 1 && !elemsNew(0).isInstanceOf[HashTrieMap[_,_]]) + if (elemsNew.length == 1 && !elemsNew(0).isInstanceOf[HashTrieMap[?,?]]) elemsNew(0) else new HashTrieMap(bitmapNew, elemsNew, sizeNew) } else OldHashMap.empty[K,V] - } else if(elems.length == 1 && !subNew.isInstanceOf[HashTrieMap[_,_]]) { + } else if(elems.length == 1 && !subNew.isInstanceOf[HashTrieMap[?,?]]) { subNew } else { val elemsNew = java.util.Arrays.copyOf(elems, elems.length) @@ -529,9 +529,9 @@ object OldHashMap extends MapFactory[OldHashMap] { } protected def merge0[V1 >: V](that: OldHashMap[K, V1], level: Int, merger: Merger[K, V1]): OldHashMap[K, V1] = that match { - case hm: OldHashMap1[_, _] => + case hm: OldHashMap1[?, ?] => this.updated0(hm.key, hm.hash, level, hm.value.asInstanceOf[V1], hm.kv, merger) - case hm: HashTrieMap[_, _] => + case hm: HashTrieMap[?, ?] => val that = hm.asInstanceOf[HashTrieMap[K, V1]] val thiselems = this.elems val thatelems = that.elems @@ -582,8 +582,8 @@ object OldHashMap extends MapFactory[OldHashMap] { } new HashTrieMap[K, V1](this.bitmap | that.bitmap, merged, totalelems) - case hm: OldHashMapCollision1[_, _] => that.merge0(this, level, merger.invert) - case hm: OldHashMap[_, _] => this + case hm: OldHashMapCollision1[?, ?] => that.merge0(this, level, merger.invert) + case hm: OldHashMap[?, ?] => this } } diff --git a/core/src/main/scala/scala/collection/immutable/OldHashSet.scala b/core/src/main/scala/scala/collection/immutable/OldHashSet.scala index 6111488c..08505f00 100644 --- a/core/src/main/scala/scala/collection/immutable/OldHashSet.scala +++ b/core/src/main/scala/scala/collection/immutable/OldHashSet.scala @@ -579,13 +579,13 @@ object OldHashSet extends IterableFactory[OldHashSet] { val sizeNew = size - sub.size // if we have only one child, which is not a HashTrieSet but a self-contained set like // OldHashSet1 or OldHashSetCollision1, return the child instead - if (elemsNew.length == 1 && !elemsNew(0).isInstanceOf[HashTrieSet[_]]) + if (elemsNew.length == 1 && !elemsNew(0).isInstanceOf[HashTrieSet[?]]) elemsNew(0) else new HashTrieSet(bitmapNew, elemsNew, sizeNew) } else null - } else if(elems.length == 1 && !subNew.isInstanceOf[HashTrieSet[_]]) { + } else if(elems.length == 1 && !subNew.isInstanceOf[HashTrieSet[?]]) { subNew } else { val elemsNew = java.util.Arrays.copyOf(elems, elems.length) diff --git a/core/src/main/scala/scala/collection/immutable/TrieIterator.scala b/core/src/main/scala/scala/collection/immutable/TrieIterator.scala index 5c618c4f..30e2f2f3 100644 --- a/core/src/main/scala/scala/collection/immutable/TrieIterator.scala +++ b/core/src/main/scala/scala/collection/immutable/TrieIterator.scala @@ -46,23 +46,23 @@ private[collection] abstract class TrieIterator[+T](elems: Array[Iterable[T]]) e private[this] var subIter = initSubIter private[this] def getElems(x: Iterable[T]): Array[Iterable[T]] = ((x: @unchecked) match { - case x: HashTrieMap[_, _] => x.elems - case x: HashTrieSet[_] => x.elems + case x: HashTrieMap[?, ?] => x.elems + case x: HashTrieSet[?] => x.elems }).asInstanceOf[Array[Iterable[T]]] private[this] def collisionToArray(x: Iterable[T]): Array[Iterable[T]] = ((x: @unchecked) match { - case x: OldHashMapCollision1[_, _] => x.kvs.map((x: (Any, Any)) => OldHashMap(x)).toArray - case x: OldHashSetCollision1[_] => x.ks.map(x => OldHashSet(x)).toArray + case x: OldHashMapCollision1[?, ?] => x.kvs.map((x: (Any, Any)) => OldHashMap(x)).toArray + case x: OldHashSetCollision1[?] => x.ks.map(x => OldHashSet(x)).toArray }).asInstanceOf[Array[Iterable[T]]] private[this] type SplitIterators = ((Iterator[T], Int), Iterator[T]) private def isTrie(x: AnyRef) = x match { - case _: HashTrieMap[_,_] | _: HashTrieSet[_] => true + case _: HashTrieMap[?,?] | _: HashTrieSet[?] => true case _ => false } private def isContainer(x: AnyRef) = x match { - case _: OldHashMap1[_, _] | _: OldHashSet1[_] => true + case _: OldHashMap1[?, ?] | _: OldHashSet1[?] => true case _ => false } @@ -84,7 +84,7 @@ private[collection] abstract class TrieIterator[+T](elems: Array[Iterable[T]]) e } private[this] def iteratorWithSize(arr: Array[Iterable[T]]): (Iterator[T], Int) = - (newIterator(arr), ((arr.map(_.size): Array[Int]): scala.collection.IterableOps[Int, scala.collection.Iterable, _]).sum) + (newIterator(arr), ((arr.map(_.size): Array[Int]): scala.collection.IterableOps[Int, scala.collection.Iterable, ?]).sum) private[this] def arrayToIterators(arr: Array[Iterable[T]]): SplitIterators = { val (fst, snd) = arr.splitAt(arr.length / 2) @@ -94,7 +94,7 @@ private[collection] abstract class TrieIterator[+T](elems: Array[Iterable[T]]) e private[this] def splitArray(ad: Array[Iterable[T]]): SplitIterators = if (ad.length > 1) arrayToIterators(ad) else ad(0) match { - case _: OldHashMapCollision1[_, _] | _: OldHashSetCollision1[_] => + case _: OldHashMapCollision1[?, ?] | _: OldHashSetCollision1[?] => arrayToIterators(collisionToArray(ad(0))) case _ => splitArray(getElems(ad(0))) diff --git a/core/src/main/scala/scala/collection/parallel/CollectionConverters.scala b/core/src/main/scala/scala/collection/parallel/CollectionConverters.scala index a27d34ba..2b14ffc6 100644 --- a/core/src/main/scala/scala/collection/parallel/CollectionConverters.scala +++ b/core/src/main/scala/scala/collection/parallel/CollectionConverters.scala @@ -27,7 +27,7 @@ object CollectionConverters { def seq = coll override def par = coll match { case coll: sc.Set[A @unchecked] => new SetIsParallelizable(coll).par - case coll: sc.Map[_, _] => new MapIsParallelizable(coll).par.asInstanceOf[ParIterable[A]] + case coll: sc.Map[?, ?] => new MapIsParallelizable(coll).par.asInstanceOf[ParIterable[A]] case coll: sci.Iterable[A] => new ImmutableIterableIsParallelizable(coll).par case coll: scm.Iterable[A @unchecked] => new MutableIterableIsParallelizable(coll).par case _ => ParIterable.newCombiner[A].fromSequential(seq) // builds ParArray, same as for scm.Iterable @@ -39,7 +39,7 @@ object CollectionConverters { override def par = coll match { case coll: scm.Seq[A] => new MutableSeqIsParallelizable(coll).par case coll: scm.Set[A] => new MutableSetIsParallelizable(coll).par - case coll: scm.Map[_, _] => new MutableMapIsParallelizable(coll).par.asInstanceOf[mutable.ParIterable[A]] + case coll: scm.Map[?, ?] => new MutableMapIsParallelizable(coll).par.asInstanceOf[mutable.ParIterable[A]] case _ => mutable.ParIterable.newCombiner[A].fromSequential(seq) // builds ParArray } } @@ -49,7 +49,7 @@ object CollectionConverters { override def par = coll match { case coll: sci.Seq[A] => new ImmutableSeqIsParallelizable(coll).par case coll: sci.Set[A @unchecked] => new ImmutableSetIsParallelizable(coll).par - case coll: sci.Map[_, _] => new ImmutableMapIsParallelizable(coll).par.asInstanceOf[immutable.ParIterable[A]] + case coll: sci.Map[?, ?] => new ImmutableMapIsParallelizable(coll).par.asInstanceOf[immutable.ParIterable[A]] case _ => immutable.ParIterable.newCombiner[A].fromSequential(seq) // builds ParVector } } @@ -85,7 +85,7 @@ object CollectionConverters { implicit class ImmutableSeqIsParallelizable[A](private val coll: sci.Seq[A]) extends AnyVal with sc.CustomParallelizable[A, immutable.ParSeq[A]] { def seq = coll override def par = coll match { - case coll: sci.Vector[_] => new VectorIsParallelizable(coll.asInstanceOf[sci.Vector[A]]).par + case coll: sci.Vector[?] => new VectorIsParallelizable(coll.asInstanceOf[sci.Vector[A]]).par case coll: sci.Range => new RangeIsParallelizable(coll).par.asInstanceOf[immutable.ParSeq[A]] case _ => immutable.ParSeq.newCombiner[A].fromSequential(seq) } diff --git a/core/src/main/scala/scala/collection/parallel/ParIterableLike.scala b/core/src/main/scala/scala/collection/parallel/ParIterableLike.scala index 4190e6e9..44a3e11c 100644 --- a/core/src/main/scala/scala/collection/parallel/ParIterableLike.scala +++ b/core/src/main/scala/scala/collection/parallel/ParIterableLike.scala @@ -328,7 +328,7 @@ extends IterableOnce[T @uncheckedVariance] if (cb.getClass == t.runtimeClass) isbody(cb.asInstanceOf[Cmb]) else notbody } } - def isCombiner = cb.isInstanceOf[Combiner[_, _]] + def isCombiner = cb.isInstanceOf[Combiner[?, ?]] def asCombiner = cb.asInstanceOf[Combiner[Elem, To]] } @@ -877,7 +877,7 @@ extends IterableOnce[T @uncheckedVariance] protected[this] trait NonDivisible[R] extends NonDivisibleTask[R, NonDivisible[R]] - protected[this] abstract class Composite[FR, SR, R, First <: StrictSplitterCheckTask[FR, _], Second <: StrictSplitterCheckTask[SR, _]] + protected[this] abstract class Composite[FR, SR, R, First <: StrictSplitterCheckTask[FR, ?], Second <: StrictSplitterCheckTask[SR, ?]] (val ft: First, val st: Second) extends NonDivisibleTask[R, Composite[FR, SR, R, First, Second]] { def combineResults(fr: FR, sr: SR): R @@ -894,7 +894,7 @@ extends IterableOnce[T @uncheckedVariance] } /** Sequentially performs one task after another. */ - protected[this] abstract class SeqComposite[FR, SR, R, First <: StrictSplitterCheckTask[FR, _], Second <: StrictSplitterCheckTask[SR, _]] + protected[this] abstract class SeqComposite[FR, SR, R, First <: StrictSplitterCheckTask[FR, ?], Second <: StrictSplitterCheckTask[SR, ?]] (f: First, s: Second) extends Composite[FR, SR, R, First, Second](f, s) { def leaf(prevr: Option[R]) = { @@ -905,7 +905,7 @@ extends IterableOnce[T @uncheckedVariance] } /** Performs two tasks in parallel, and waits for both to finish. */ - protected[this] abstract class ParComposite[FR, SR, R, First <: StrictSplitterCheckTask[FR, _], Second <: StrictSplitterCheckTask[SR, _]] + protected[this] abstract class ParComposite[FR, SR, R, First <: StrictSplitterCheckTask[FR, ?], Second <: StrictSplitterCheckTask[SR, ?]] (f: First, s: Second) extends Composite[FR, SR, R, First, Second](f, s) { def leaf(prevr: Option[R]) = { diff --git a/core/src/main/scala/scala/collection/parallel/ParMapLike.scala b/core/src/main/scala/scala/collection/parallel/ParMapLike.scala index ea2b1b99..d1bf09f8 100644 --- a/core/src/main/scala/scala/collection/parallel/ParMapLike.scala +++ b/core/src/main/scala/scala/collection/parallel/ParMapLike.scala @@ -53,7 +53,7 @@ self => * same mappings, `false` otherwise. */ override def equals(that: Any): Boolean = that match { - case that: ParMap[b, _] => + case that: ParMap[b, ?] => (this eq that) || (that canEqual this) && (this.size == that.size) && { diff --git a/core/src/main/scala/scala/collection/parallel/ParSeqLike.scala b/core/src/main/scala/scala/collection/parallel/ParSeqLike.scala index 29cbefd3..bc1400a4 100644 --- a/core/src/main/scala/scala/collection/parallel/ParSeqLike.scala +++ b/core/src/main/scala/scala/collection/parallel/ParSeqLike.scala @@ -467,7 +467,7 @@ extends ParIterableLike[T, CC, Repr, Sequential] /* tasks */ - protected[this] def down(p: IterableSplitter[_]) = p.asInstanceOf[SeqSplitter[T]] + protected[this] def down(p: IterableSplitter[?]) = p.asInstanceOf[SeqSplitter[T]] protected trait ParSeqLikeAccessor[R, Tp] extends Accessor[R, Tp] { protected[this] val pit: SeqSplitter[T] diff --git a/core/src/main/scala/scala/collection/parallel/ParSetLike.scala b/core/src/main/scala/scala/collection/parallel/ParSetLike.scala index 72069d00..0f38a6a1 100644 --- a/core/src/main/scala/scala/collection/parallel/ParSetLike.scala +++ b/core/src/main/scala/scala/collection/parallel/ParSetLike.scala @@ -97,7 +97,7 @@ extends ParIterableLike[T, CC, Repr, Sequential] * as this set. */ override def equals(that: Any): Boolean = that match { - case that: ParSet[_] => + case that: ParSet[?] => (this eq that) || (that canEqual this) && (this.size == that.size) && diff --git a/core/src/main/scala/scala/collection/parallel/Tasks.scala b/core/src/main/scala/scala/collection/parallel/Tasks.scala index fb1a278d..5a322624 100644 --- a/core/src/main/scala/scala/collection/parallel/Tasks.scala +++ b/core/src/main/scala/scala/collection/parallel/Tasks.scala @@ -68,7 +68,7 @@ trait Task[R, +Tp] { mergeThrowables(that) } - private[parallel] def mergeThrowables(that: Task[_, _]): Unit = + private[parallel] def mergeThrowables(that: Task[?, ?]): Unit = if (this.throwable != null) { if (that.throwable != null && (this.throwable ne that.throwable)) this.throwable.addSuppressed(that.throwable) diff --git a/core/src/main/scala/scala/collection/parallel/immutable/ParHashMap.scala b/core/src/main/scala/scala/collection/parallel/immutable/ParHashMap.scala index a7189efe..2952a50d 100644 --- a/core/src/main/scala/scala/collection/parallel/immutable/ParHashMap.scala +++ b/core/src/main/scala/scala/collection/parallel/immutable/ParHashMap.scala @@ -305,10 +305,10 @@ extends scala.collection.parallel.BucketCombiner[(K, V), ParHashMap[K, V], (K, V evaluateCombiners(trie).asInstanceOf[OldHashMap[K, Repr]] } private def evaluateCombiners(trie: OldHashMap[K, Combiner[V, Repr]]): OldHashMap[K, Repr] = trie match { - case hm1: OldHashMap.OldHashMap1[_, _] => + case hm1: OldHashMap.OldHashMap1[?, ?] => val evaledvalue = hm1.value.result() new OldHashMap.OldHashMap1[K, Repr](hm1.key, hm1.hash, evaledvalue, null) - case hmc: OldHashMap.OldHashMapCollision1[_, Combiner[_, Repr]] => + case hmc: OldHashMap.OldHashMapCollision1[?, Combiner[?, Repr]] => val evaledkvs = hmc.kvs map { p => (p._1, p._2.result()) } new OldHashMap.OldHashMapCollision1[K, Repr](hmc.hash, evaledkvs) case htm: OldHashMap.HashTrieMap[k, v] => diff --git a/core/src/main/scala/scala/collection/parallel/mutable/LazyCombiner.scala b/core/src/main/scala/scala/collection/parallel/mutable/LazyCombiner.scala index ad5869a4..a7b13d60 100644 --- a/core/src/main/scala/scala/collection/parallel/mutable/LazyCombiner.scala +++ b/core/src/main/scala/scala/collection/parallel/mutable/LazyCombiner.scala @@ -34,7 +34,7 @@ trait LazyCombiner[Elem, +To, Buff <: Growable[Elem] with Sizing] extends Combin def result(): To = allocateAndCopy def clear() = { chain.clear() } def combine[N <: Elem, NewTo >: To](other: Combiner[N, NewTo]): Combiner[N, NewTo] = if (this ne other) { - if (other.isInstanceOf[LazyCombiner[_, _, _]]) { + if (other.isInstanceOf[LazyCombiner[?, ?, ?]]) { val that = other.asInstanceOf[LazyCombiner[Elem, To, Buff]] newLazyCombiner(chain ++= that.chain) } else throw new UnsupportedOperationException("Cannot combine with combiner of different type.") diff --git a/core/src/main/scala/scala/collection/parallel/mutable/ParTrieMap.scala b/core/src/main/scala/scala/collection/parallel/mutable/ParTrieMap.scala index ec0a0b40..3dcfbb43 100644 --- a/core/src/main/scala/scala/collection/parallel/mutable/ParTrieMap.scala +++ b/core/src/main/scala/scala/collection/parallel/mutable/ParTrieMap.scala @@ -80,9 +80,9 @@ extends ParMap[K, V] val in = ctrie.readRoot() val r = in.gcasRead(ctrie) (r: @unchecked) match { - case tn: TNode[_, _] => tn.cachedSize(ctrie) - case ln: LNode[_, _] => ln.cachedSize(ctrie) - case cn: CNode[_, _] => + case tn: TNode[?, ?] => tn.cachedSize(ctrie) + case ln: LNode[?, ?] => ln.cachedSize(ctrie) + case cn: CNode[?, ?] => tasksupport.executeAndWaitResult(new Size(0, cn.array.length, cn.array)) cn.cachedSize(ctrie) } @@ -103,7 +103,7 @@ extends ParMap[K, V] val until = offset + howmany while (i < until) { (array(i): @unchecked) match { - case sn: SNode[_, _] => sz += 1 + case sn: SNode[?, ?] => sz += 1 case in: INode[K @unchecked, V @unchecked] => sz += in.cachedSize(ctrie) } i += 1 diff --git a/core/src/main/scala/scala/collection/parallel/package.scala b/core/src/main/scala/scala/collection/parallel/package.scala index 8c61fef5..3cb7133a 100644 --- a/core/src/main/scala/scala/collection/parallel/package.scala +++ b/core/src/main/scala/scala/collection/parallel/package.scala @@ -40,7 +40,7 @@ package object parallel { def setTaskSupport[Coll](c: Coll, t: TaskSupport): Coll = { c match { - case pc: ParIterableLike[_, _, _, _] => pc.tasksupport = t + case pc: ParIterableLike[?, ?, ?, ?] => pc.tasksupport = t case _ => // do nothing } c @@ -50,7 +50,7 @@ package object parallel { implicit class CollectionsHaveToParArray[C, T](c: C)(implicit asGto: C => scala.collection.IterableOnce[T]) { def toParArray = { val t = asGto(c) - if (t.isInstanceOf[ParArray[_]]) t.asInstanceOf[ParArray[T]] + if (t.isInstanceOf[ParArray[?]]) t.asInstanceOf[ParArray[T]] else { val it = t.iterator val cb = mutable.ParArrayCombiner[T]() @@ -67,9 +67,9 @@ package parallel { private[collection] object ParallelCollectionImplicits { implicit def traversable2ops[T](t: scala.collection.IterableOnce[T]): TraversableOps[T] = new TraversableOps[T] { def isParallel = t.isInstanceOf[Parallel] - def isParIterable = t.isInstanceOf[ParIterable[_]] + def isParIterable = t.isInstanceOf[ParIterable[?]] def asParIterable = t.asInstanceOf[ParIterable[T]] - def isParSeq = t.isInstanceOf[ParSeq[_]] + def isParSeq = t.isInstanceOf[ParSeq[?]] def asParSeq = t.asInstanceOf[ParSeq[T]] def ifParSeq[R](isbody: ParSeq[T] => R) = new Otherwise[R] { def otherwise(notbody: => R) = if (isParallel) isbody(asParSeq) else notbody @@ -184,7 +184,7 @@ package parallel { def combine[N <: Elem, NewTo >: To](other: Combiner[N, NewTo]): Combiner[N, NewTo] = { if (this eq other) this else other match { - case _: BucketCombiner[_, _, _, _] => + case _: BucketCombiner[?, ?, ?, ?] => beforeCombine(other) val that = other.asInstanceOf[BucketCombiner[Elem, To, Buck, CombinerType]] diff --git a/junit/src/test/scala/MiscTest.scala b/junit/src/test/scala/MiscTest.scala index 38d7aaea..5c33f06f 100644 --- a/junit/src/test/scala/MiscTest.scala +++ b/junit/src/test/scala/MiscTest.scala @@ -25,7 +25,7 @@ class MiscTest { } } - def foo(arg: ParSeq[_]): String = arg.map(x => x).mkString(",") + def foo(arg: ParSeq[?]): String = arg.map(x => x).mkString(",") @Test def si4608: Unit = { @@ -113,9 +113,9 @@ class MiscTest { @Test def si6510: Unit = { val x = collection.parallel.mutable.ParArray.range(1,10) groupBy { _ % 2 } mapValues { _.size } - assertTrue(x.isInstanceOf[parallel.ParMap[_, _]]) + assertTrue(x.isInstanceOf[parallel.ParMap[?, ?]]) val y = collection.parallel.immutable.ParVector.range(1,10) groupBy { _ % 2 } mapValues { _.size } - assertTrue(y.isInstanceOf[parallel.ParMap[_, _]]) + assertTrue(y.isInstanceOf[parallel.ParMap[?, ?]]) } @Test diff --git a/junit/src/test/scala/scala/collection/NewBuilderTest.scala b/junit/src/test/scala/scala/collection/NewBuilderTest.scala index 51fd380c..8f82bc98 100644 --- a/junit/src/test/scala/scala/collection/NewBuilderTest.scala +++ b/junit/src/test/scala/scala/collection/NewBuilderTest.scala @@ -34,85 +34,85 @@ class NewBuilderTest { assertTrue(s"$mapped (of class ${mapped.getClass} is not a in instance of ${expected}", isInstance) } - test[sc.Iterable[_] ]((sc.Iterable(1): sc.Iterable[Int]).map(x => x)) - test[sc.Seq[_] ]((sc.Seq(1): sc.Iterable[Int]).map(x => x)) - test[sc.LinearSeq[_] ]((sc.LinearSeq(1): sc.Iterable[Int]).map(x => x)) - test[sc.LinearSeq[_] ]((sc.LinearSeq(1): sc.Seq[Int] ).map(x => x)) - test[sc.IndexedSeq[_] ]((sc.IndexedSeq(1): sc.Iterable[Int]).map(x => x)) - test[sc.IndexedSeq[_] ]((sc.IndexedSeq(1): sc.Seq[Int] ).map(x => x)) - test[sc.Set[_] ]((sc.Set(1): sc.Iterable[Int]).map(x => x)) - test[sc.Map[_, _] ]((sc.Map(1 -> 1): sc.Map[Int, Int]).map(x => x)) - - test[scm.Iterable[_] ]((scm.Iterable(1): sc.Iterable[Int]).map(x => x)) - test[scm.Queue[_] ]((scm.Queue(1): sc.Iterable[Int]).map(x => x)) - test[scm.Queue[_] ]((scm.Queue(1): sc.Seq[Int] ).map(x => x)) - test[scm.ArraySeq[_] ]((scm.ArraySeq(1): sc.Iterable[Int]).map(x => x)) - test[scm.ArraySeq[_] ]((scm.ArraySeq(1): sc.Seq[Int] ).map(x => x)) - - test[scm.Buffer[_] ]((scm.Buffer(1): sc.Iterable[Int]).map(x => x)) - test[scm.Buffer[_] ]((scm.Buffer(1): sc.Seq[Int] ).map(x => x)) - test[scm.IndexedSeq[_] ]((scm.IndexedSeq(1): sc.Iterable[Int]).map(x => x)) - test[scm.IndexedSeq[_] ]((scm.IndexedSeq(1): sc.Seq[Int] ).map(x => x)) - test[scm.ArrayBuffer[_] ]((scm.ArrayBuffer(1): sc.Iterable[Int]).map(x => x)) - test[scm.ArrayBuffer[_] ]((scm.ArrayBuffer(1): sc.Seq[Int] ).map(x => x)) - test[scm.ListBuffer[_] ]((scm.ListBuffer(1): sc.Iterable[Int]).map(x => x)) - test[scm.ListBuffer[_] ]((scm.ListBuffer(1): sc.Seq[Int] ).map(x => x)) - test[scm.Seq[_] ]((scm.Seq(1): sc.Iterable[Int]).map(x => x)) - test[scm.Seq[_] ]((scm.Seq(1): sc.Seq[Int] ).map(x => x)) - test[scm.Set[_] ]((scm.Set(1): sc.Iterable[Int]).map(x => x)) - test[scm.Set[_] ]((scm.Set(1): sc.Set[Int] ).map(x => x)) - test[scm.HashSet[_] ]((scm.HashSet(1): sc.Iterable[Int]).map(x => x)) - test[scm.HashSet[_] ]((scm.HashSet(1): sc.Set[Int] ).map(x => x)) - test[scm.LinkedHashSet[_] ]((scm.LinkedHashSet(1): sc.Iterable[Int]).map(x => x)) - test[scm.LinkedHashSet[_] ]((scm.LinkedHashSet(1): sc.Set[Int] ).map(x => x)) - - test[sci.Iterable[_] ]((sci.Iterable(1): sc.Iterable[Int]).map(x => x)) - test[sci.LinearSeq[_] ]((sci.LinearSeq(1): sc.Iterable[Int]).map(x => x)) - test[sci.LinearSeq[_] ]((sci.LinearSeq(1): sc.Seq[Int] ).map(x => x)) - test[sci.List[_] ]((sci.List(1): sc.Iterable[Int]).map(x => x)) - test[sci.List[_] ]((sci.List(1): sc.Seq[Int] ).map(x => x)) - test[sci.LazyList[_] ]((sci.LazyList(1): sc.Iterable[Int]).map(x => x)) - test[sci.LazyList[_] ]((sci.LazyList(1): sc.Seq[Int] ).map(x => x)) - test[sci.Queue[_] ]((sci.Queue(1): sc.Iterable[Int]).map(x => x)) - test[sci.Queue[_] ]((sci.Queue(1): sc.Seq[Int] ).map(x => x)) - test[sci.IndexedSeq[_] ]((sci.IndexedSeq(1): sc.Iterable[Int]).map(x => x)) - test[sci.IndexedSeq[_] ]((sci.IndexedSeq(1): sc.Seq[Int] ).map(x => x)) - test[sci.Vector[_] ]((sci.Vector(1): sc.Iterable[Int]).map(x => x)) - test[sci.Vector[_] ]((sci.Vector(1): sc.Seq[Int] ).map(x => x)) - test[sci.Seq[_] ]((sci.Seq(1): sc.Iterable[Int]).map(x => x)) - test[sci.Seq[_] ]((sci.Seq(1): sc.Seq[Int] ).map(x => x)) - test[sci.Set[_] ]((sci.Set(1): sc.Iterable[Int]).map(x => x)) - test[sci.Set[_] ]((sci.Set(1): sc.Set[Int] ).map(x => x)) - test[sci.ListSet[_] ]((sci.ListSet(1): sc.Iterable[Int]).map(x => x)) - test[sci.ListSet[_] ]((sci.ListSet(1): sc.Set[Int] ).map(x => x)) - test[sci.HashSet[_] ]((sci.HashSet(1): sc.Iterable[Int]).map(x => x)) - test[sci.HashSet[_] ]((sci.HashSet(1): sc.Set[Int] ).map(x => x)) - - test[scp.ParIterable[_] ]((scp.ParIterable(1): scp.ParIterable[Int]).map(x => x)) - test[scp.ParSeq[_] ]((scp.ParSeq(1): scp.ParIterable[Int]).map(x => x)) - test[scp.ParSeq[_] ]((scp.ParSeq(1): scp.ParSeq[Int] ).map(x => x)) - test[scp.ParSet[_] ]((scp.ParSet(1): scp.ParIterable[Int]).map(x => x)) - test[scp.ParSet[_] ]((scp.ParSet(1): scp.ParSet[Int] ).map(x => x)) - - test[scpm.ParIterable[_] ]((scpm.ParIterable(1): scp.ParIterable[Int]).map(x => x)) - test[scpm.ParSeq[_] ]((scpm.ParSeq(1): scp.ParIterable[Int]).map(x => x)) - test[scpm.ParSeq[_] ]((scpm.ParSeq(1): scp.ParSeq[Int] ).map(x => x)) - test[scpm.ParArray[_] ]((scpm.ParArray(1): scp.ParIterable[Int]).map(x => x)) - test[scpm.ParArray[_] ]((scpm.ParArray(1): scp.ParSeq[Int] ).map(x => x)) - test[scpm.ParSet[_] ]((scpm.ParSet(1): scp.ParIterable[Int]).map(x => x)) - test[scpm.ParSet[_] ]((scpm.ParSet(1): scp.ParSet[Int] ).map(x => x)) - test[scpm.ParHashSet[_] ]((scpm.ParHashSet(1): scp.ParIterable[Int]).map(x => x)) - test[scpm.ParHashSet[_] ]((scpm.ParHashSet(1): scp.ParSet[Int] ).map(x => x)) - - test[scpi.ParIterable[_] ]((scpi.ParIterable(1): scp.ParIterable[Int]).map(x => x)) - test[scpi.ParSeq[_] ]((scpi.ParSeq(1): scp.ParIterable[Int]).map(x => x)) - test[scpi.ParSeq[_] ]((scpi.ParSeq(1): scp.ParSeq[Int] ).map(x => x)) - test[scpi.ParVector[_] ]((scpi.ParVector(1): scp.ParIterable[Int]).map(x => x)) - test[scpi.ParVector[_] ]((scpi.ParVector(1): scp.ParSeq[Int] ).map(x => x)) - test[scpi.ParSet[_] ]((scpi.ParSet(1): scp.ParIterable[Int]).map(x => x)) - test[scpi.ParSet[_] ]((scpi.ParSet(1): scp.ParSet[Int] ).map(x => x)) - test[scpi.ParHashSet[_] ]((scpi.ParHashSet(1): scp.ParIterable[Int]).map(x => x)) - test[scpi.ParHashSet[_] ]((scpi.ParHashSet(1): scp.ParSet[Int] ).map(x => x)) + test[sc.Iterable[?] ]((sc.Iterable(1): sc.Iterable[Int]).map(x => x)) + test[sc.Seq[?] ]((sc.Seq(1): sc.Iterable[Int]).map(x => x)) + test[sc.LinearSeq[?] ]((sc.LinearSeq(1): sc.Iterable[Int]).map(x => x)) + test[sc.LinearSeq[?] ]((sc.LinearSeq(1): sc.Seq[Int] ).map(x => x)) + test[sc.IndexedSeq[?] ]((sc.IndexedSeq(1): sc.Iterable[Int]).map(x => x)) + test[sc.IndexedSeq[?] ]((sc.IndexedSeq(1): sc.Seq[Int] ).map(x => x)) + test[sc.Set[?] ]((sc.Set(1): sc.Iterable[Int]).map(x => x)) + test[sc.Map[?, ?] ]((sc.Map(1 -> 1): sc.Map[Int, Int]).map(x => x)) + + test[scm.Iterable[?] ]((scm.Iterable(1): sc.Iterable[Int]).map(x => x)) + test[scm.Queue[?] ]((scm.Queue(1): sc.Iterable[Int]).map(x => x)) + test[scm.Queue[?] ]((scm.Queue(1): sc.Seq[Int] ).map(x => x)) + test[scm.ArraySeq[?] ]((scm.ArraySeq(1): sc.Iterable[Int]).map(x => x)) + test[scm.ArraySeq[?] ]((scm.ArraySeq(1): sc.Seq[Int] ).map(x => x)) + + test[scm.Buffer[?] ]((scm.Buffer(1): sc.Iterable[Int]).map(x => x)) + test[scm.Buffer[?] ]((scm.Buffer(1): sc.Seq[Int] ).map(x => x)) + test[scm.IndexedSeq[?] ]((scm.IndexedSeq(1): sc.Iterable[Int]).map(x => x)) + test[scm.IndexedSeq[?] ]((scm.IndexedSeq(1): sc.Seq[Int] ).map(x => x)) + test[scm.ArrayBuffer[?] ]((scm.ArrayBuffer(1): sc.Iterable[Int]).map(x => x)) + test[scm.ArrayBuffer[?] ]((scm.ArrayBuffer(1): sc.Seq[Int] ).map(x => x)) + test[scm.ListBuffer[?] ]((scm.ListBuffer(1): sc.Iterable[Int]).map(x => x)) + test[scm.ListBuffer[?] ]((scm.ListBuffer(1): sc.Seq[Int] ).map(x => x)) + test[scm.Seq[?] ]((scm.Seq(1): sc.Iterable[Int]).map(x => x)) + test[scm.Seq[?] ]((scm.Seq(1): sc.Seq[Int] ).map(x => x)) + test[scm.Set[?] ]((scm.Set(1): sc.Iterable[Int]).map(x => x)) + test[scm.Set[?] ]((scm.Set(1): sc.Set[Int] ).map(x => x)) + test[scm.HashSet[?] ]((scm.HashSet(1): sc.Iterable[Int]).map(x => x)) + test[scm.HashSet[?] ]((scm.HashSet(1): sc.Set[Int] ).map(x => x)) + test[scm.LinkedHashSet[?] ]((scm.LinkedHashSet(1): sc.Iterable[Int]).map(x => x)) + test[scm.LinkedHashSet[?] ]((scm.LinkedHashSet(1): sc.Set[Int] ).map(x => x)) + + test[sci.Iterable[?] ]((sci.Iterable(1): sc.Iterable[Int]).map(x => x)) + test[sci.LinearSeq[?] ]((sci.LinearSeq(1): sc.Iterable[Int]).map(x => x)) + test[sci.LinearSeq[?] ]((sci.LinearSeq(1): sc.Seq[Int] ).map(x => x)) + test[sci.List[?] ]((sci.List(1): sc.Iterable[Int]).map(x => x)) + test[sci.List[?] ]((sci.List(1): sc.Seq[Int] ).map(x => x)) + test[sci.LazyList[?] ]((sci.LazyList(1): sc.Iterable[Int]).map(x => x)) + test[sci.LazyList[?] ]((sci.LazyList(1): sc.Seq[Int] ).map(x => x)) + test[sci.Queue[?] ]((sci.Queue(1): sc.Iterable[Int]).map(x => x)) + test[sci.Queue[?] ]((sci.Queue(1): sc.Seq[Int] ).map(x => x)) + test[sci.IndexedSeq[?] ]((sci.IndexedSeq(1): sc.Iterable[Int]).map(x => x)) + test[sci.IndexedSeq[?] ]((sci.IndexedSeq(1): sc.Seq[Int] ).map(x => x)) + test[sci.Vector[?] ]((sci.Vector(1): sc.Iterable[Int]).map(x => x)) + test[sci.Vector[?] ]((sci.Vector(1): sc.Seq[Int] ).map(x => x)) + test[sci.Seq[?] ]((sci.Seq(1): sc.Iterable[Int]).map(x => x)) + test[sci.Seq[?] ]((sci.Seq(1): sc.Seq[Int] ).map(x => x)) + test[sci.Set[?] ]((sci.Set(1): sc.Iterable[Int]).map(x => x)) + test[sci.Set[?] ]((sci.Set(1): sc.Set[Int] ).map(x => x)) + test[sci.ListSet[?] ]((sci.ListSet(1): sc.Iterable[Int]).map(x => x)) + test[sci.ListSet[?] ]((sci.ListSet(1): sc.Set[Int] ).map(x => x)) + test[sci.HashSet[?] ]((sci.HashSet(1): sc.Iterable[Int]).map(x => x)) + test[sci.HashSet[?] ]((sci.HashSet(1): sc.Set[Int] ).map(x => x)) + + test[scp.ParIterable[?] ]((scp.ParIterable(1): scp.ParIterable[Int]).map(x => x)) + test[scp.ParSeq[?] ]((scp.ParSeq(1): scp.ParIterable[Int]).map(x => x)) + test[scp.ParSeq[?] ]((scp.ParSeq(1): scp.ParSeq[Int] ).map(x => x)) + test[scp.ParSet[?] ]((scp.ParSet(1): scp.ParIterable[Int]).map(x => x)) + test[scp.ParSet[?] ]((scp.ParSet(1): scp.ParSet[Int] ).map(x => x)) + + test[scpm.ParIterable[?] ]((scpm.ParIterable(1): scp.ParIterable[Int]).map(x => x)) + test[scpm.ParSeq[?] ]((scpm.ParSeq(1): scp.ParIterable[Int]).map(x => x)) + test[scpm.ParSeq[?] ]((scpm.ParSeq(1): scp.ParSeq[Int] ).map(x => x)) + test[scpm.ParArray[?] ]((scpm.ParArray(1): scp.ParIterable[Int]).map(x => x)) + test[scpm.ParArray[?] ]((scpm.ParArray(1): scp.ParSeq[Int] ).map(x => x)) + test[scpm.ParSet[?] ]((scpm.ParSet(1): scp.ParIterable[Int]).map(x => x)) + test[scpm.ParSet[?] ]((scpm.ParSet(1): scp.ParSet[Int] ).map(x => x)) + test[scpm.ParHashSet[?] ]((scpm.ParHashSet(1): scp.ParIterable[Int]).map(x => x)) + test[scpm.ParHashSet[?] ]((scpm.ParHashSet(1): scp.ParSet[Int] ).map(x => x)) + + test[scpi.ParIterable[?] ]((scpi.ParIterable(1): scp.ParIterable[Int]).map(x => x)) + test[scpi.ParSeq[?] ]((scpi.ParSeq(1): scp.ParIterable[Int]).map(x => x)) + test[scpi.ParSeq[?] ]((scpi.ParSeq(1): scp.ParSeq[Int] ).map(x => x)) + test[scpi.ParVector[?] ]((scpi.ParVector(1): scp.ParIterable[Int]).map(x => x)) + test[scpi.ParVector[?] ]((scpi.ParVector(1): scp.ParSeq[Int] ).map(x => x)) + test[scpi.ParSet[?] ]((scpi.ParSet(1): scp.ParIterable[Int]).map(x => x)) + test[scpi.ParSet[?] ]((scpi.ParSet(1): scp.ParSet[Int] ).map(x => x)) + test[scpi.ParHashSet[?] ]((scpi.ParHashSet(1): scp.ParIterable[Int]).map(x => x)) + test[scpi.ParHashSet[?] ]((scpi.ParHashSet(1): scp.ParSet[Int] ).map(x => x)) // These go through `GenMap.canBuildFrom`. There is no simple fix for Map like there is for Set. // A Map does not provide access to its companion object at runtime. (The `companion` field diff --git a/scalacheck/src/test/scala/ParallelIterableCheck.scala b/scalacheck/src/test/scala/ParallelIterableCheck.scala index 4102a127..2af34fb1 100644 --- a/scalacheck/src/test/scala/ParallelIterableCheck.scala +++ b/scalacheck/src/test/scala/ParallelIterableCheck.scala @@ -81,7 +81,7 @@ abstract class ParallelIterableCheck[T](collName: String) extends Properties(col def areEqual(t1: Iterable[T], t2: ParIterable[T]) = if (hasStrictOrder) { t1.iterator.sameElements(t2) && t2.sameElements(t1) } else (t1, t2) match { // it is slightly delicate what `equal` means if the order is not strict - case (m1: Map[_, _], m2: ParMap[_, _]) => + case (m1: Map[?, ?], m2: ParMap[?, ?]) => val am1: Map[Any, Any] = m1.asInstanceOf[Map[Any, Any]] val am2: ParMap[Any, Any] = m2.asInstanceOf[ParMap[Any, Any]] am1.forall { case (k, v) => am2.get(k).contains(v) } && am2.forall { case (k, v) => am1.get(k).contains(v) } @@ -98,7 +98,7 @@ abstract class ParallelIterableCheck[T](collName: String) extends Properties(col println(coll.tasksupport.debugMessages.mkString("\n")) } - def printComparison(t: Iterable[_], coll: ParIterable[_], tf: Iterable[_], cf: ParIterable[_], ind: Int): Unit = { + def printComparison(t: Iterable[?], coll: ParIterable[?], tf: Iterable[?], cf: ParIterable[?], ind: Int): Unit = { printDebugInfo(coll) println("Operator: " + ind) println("sz: " + t.size)