Skip to content

Commit b43a957

Browse files
committed
Replace old wildcard syntax
1 parent f08de70 commit b43a957

40 files changed

+114
-114
lines changed

library/src/scala/Array.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ object Array {
190190
def apply[T: ClassTag](xs: T*): Array[T] = {
191191
val len = xs.length
192192
xs match {
193-
case wa: immutable.ArraySeq[_] if wa.unsafeArray.getClass.getComponentType == classTag[T].runtimeClass =>
193+
case wa: immutable.ArraySeq[?] if wa.unsafeArray.getClass.getComponentType == classTag[T].runtimeClass =>
194194
// We get here in test/files/run/sd760a.scala, `Array[T](t)` for
195195
// a specialized type parameter `T`. While we still pay for two
196196
// copies of the array it is better than before when we also boxed

library/src/scala/NamedTuple.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ object NamedTupleDecomposition:
223223

224224
/** The names of a named tuple, represented as a tuple of literal string values. */
225225
type Names[X <: AnyNamedTuple] <: Tuple = X match
226-
case NamedTuple[n, _] => n
226+
case NamedTuple[n, ?] => n
227227

228228
/** The value types of a named tuple represented as a regular tuple. */
229229
type DropNames[NT <: AnyNamedTuple] <: Tuple = NT match
230-
case NamedTuple[_, x] => x
230+
case NamedTuple[?, x] => x

library/src/scala/collection/ArrayOps.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -994,10 +994,10 @@ final class ArrayOps[A](private val xs: Array[A]) extends AnyVal {
994994
var i = 0
995995
while(i < len) {
996996
xs(i) match {
997-
case it: IterableOnce[_] =>
997+
case it: IterableOnce[?] =>
998998
val k = it.knownSize
999999
if(k > 0) size += k
1000-
case a: Array[_] => size += a.length
1000+
case a: Array[?] => size += a.length
10011001
case _ =>
10021002
}
10031003
i += 1

library/src/scala/collection/IndexedSeq.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ transparent trait IndexedSeqOps[+A, +CC[_], +C] extends Any with SeqOps[A, CC, C
104104
if (!isEmpty) apply(0)
105105
else throw new NoSuchElementException(s"head of empty ${
106106
self match {
107-
case self: IndexedSeq[_] => self.collectionClassName
107+
case self: IndexedSeq[?] => self.collectionClassName
108108
case _ => toString
109109
}
110110
}")
@@ -115,7 +115,7 @@ transparent trait IndexedSeqOps[+A, +CC[_], +C] extends Any with SeqOps[A, CC, C
115115
if (!isEmpty) apply(length - 1)
116116
else throw new NoSuchElementException(s"last of empty ${
117117
self match {
118-
case self: IndexedSeq[_] => self.collectionClassName
118+
case self: IndexedSeq[?] => self.collectionClassName
119119
case _ => toString
120120
}
121121
}")

library/src/scala/collection/Iterable.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ trait MapFactoryDefaults[K, +V,
10221022
override protected def newSpecificBuilder: mutable.Builder[(K, V @uncheckedVariance), CC[K, V @uncheckedVariance]] = mapFactory.newBuilder[K, V]
10231023
override def empty: CC[K, V @uncheckedVariance] = (this: AnyRef) match {
10241024
// Implemented here instead of in TreeSeqMap since overriding empty in TreeSeqMap is not forwards compatible (should be moved)
1025-
case self: immutable.TreeSeqMap[_, _] => immutable.TreeSeqMap.empty(self.orderedBy).asInstanceOf[CC[K, V]]
1025+
case self: immutable.TreeSeqMap[?, ?] => immutable.TreeSeqMap.empty(self.orderedBy).asInstanceOf[CC[K, V]]
10261026
case _ => mapFactory.empty
10271027
}
10281028

library/src/scala/collection/LinearSeq.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ transparent trait LinearSeqOps[+A, +CC[X] <: LinearSeq[X], +C <: LinearSeq[A] &
104104

105105
if (thatKnownSize >= 0) this lengthCompare thatKnownSize
106106
else that match {
107-
case that: LinearSeq[_] =>
107+
case that: LinearSeq[?] =>
108108
var thisSeq = this
109109
var thatSeq = that
110110
while (thisSeq.nonEmpty && thatSeq.nonEmpty) {

library/src/scala/collection/Map.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ trait Map[K, +V]
6666
*/
6767
override def equals(o: Any): Boolean =
6868
(this eq o.asInstanceOf[AnyRef]) || (o match {
69-
case map: Map[K @unchecked, _] if map.canEqual(this) =>
69+
case map: Map[K @unchecked, ?] if map.canEqual(this) =>
7070
(this.size == map.size) && {
7171
try this.forall(kv => map.getOrElse(kv._1, Map.DefaultSentinelFn()) == kv._2)
7272
catch { case _: ClassCastException => false } // PR #9565 / scala/bug#12228

library/src/scala/collection/Seq.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ object SeqOps {
10731073
}
10741074
// Now we know we actually need KMP search, so do it
10751075
else S match {
1076-
case xs: scala.collection.IndexedSeq[_] =>
1076+
case xs: scala.collection.IndexedSeq[?] =>
10771077
// We can index into S directly; it should be adequately fast
10781078
val Wopt = kmpOptimizeWord(W, n0, n1, forward)
10791079
val T = kmpJumpTable(Wopt, n1-n0)

library/src/scala/collection/SortedMap.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ trait SortedMap[K, +V]
3333

3434
override def equals(that: Any): Boolean = that match {
3535
case _ if this eq that.asInstanceOf[AnyRef] => true
36-
case sm: SortedMap[K @unchecked, _] if sm.ordering == this.ordering =>
36+
case sm: SortedMap[K @unchecked, ?] if sm.ordering == this.ordering =>
3737
(sm canEqual this) &&
3838
(this.size == sm.size) && {
3939
val i1 = this.iterator

library/src/scala/collection/concurrent/TrieMap.scala

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ private[collection] final class INode[K, V](bn: MainNode[K, V] | Null, g: Gen, e
5555
prev match {
5656
case null =>
5757
m
58-
case fn: FailedNode[_, _] => // try to commit to previous value
58+
case fn: FailedNode[?, ?] => // try to commit to previous value
5959
if (CAS(m, fn.prev)) fn.prev
6060
else GCAS_Complete(/*READ*/mainnode, ct)
61-
case vn: MainNode[_, _] =>
61+
case vn: MainNode[?, ?] =>
6262
// Assume that you've read the root from the generation G.
6363
// Assume that the snapshot algorithm is correct.
6464
// ==> you can only reach nodes in generations <= G.
@@ -284,7 +284,7 @@ private[collection] final class INode[K, V](bn: MainNode[K, V] | Null, g: Gen, e
284284
case basicNode => throw new MatchError(basicNode)
285285
}
286286
}
287-
case tn: TNode[_, _] => // 3) non-live node
287+
case tn: TNode[?, ?] => // 3) non-live node
288288
def cleanReadOnly(tn: TNode[K, V]) = if (ct.nonReadOnly) {
289289
clean(parent.nn, ct, lev - 5)
290290
RESTART
@@ -412,9 +412,9 @@ private[collection] final class INode[K, V](bn: MainNode[K, V] | Null, g: Gen, e
412412
/* this is a quiescent method! */
413413
def string(lev: Int): String = "%sINode -> %s".format(" " * lev, mainnode match {
414414
case null => "<null>"
415-
case tn: TNode[_, _] => "TNode(%s, %s, %d, !)".format(tn.k, tn.v, tn.hc)
416-
case cn: CNode[_, _] => cn.string(lev)
417-
case ln: LNode[_, _] => ln.string(lev)
415+
case tn: TNode[?, ?] => "TNode(%s, %s, %d, !)".format(tn.k, tn.v, tn.hc)
416+
case cn: CNode[?, ?] => cn.string(lev)
417+
case ln: LNode[?, ?] => ln.string(lev)
418418
case x => "<elem: %s>".format(x)
419419
})
420420

@@ -549,7 +549,7 @@ private[collection] final class CNode[K, V](val bitmap: Int, val array: Array[Ba
549549
while (i < array.length) {
550550
val pos = (i + offset) % array.length
551551
array(pos) match {
552-
case sn: SNode[_, _] => sz += 1
552+
case sn: SNode[?, ?] => sz += 1
553553
case in: INode[K, V] @uc => sz += in.cachedSize(ct)
554554
case basicNode => throw new MatchError(basicNode)
555555
}
@@ -604,7 +604,7 @@ private[collection] final class CNode[K, V](val bitmap: Int, val array: Array[Ba
604604
}
605605

606606
private def resurrect(inode: INode[K, V], inodemain: AnyRef): BasicNode = inodemain match {
607-
case tn: TNode[_, _] => tn.copyUntombed
607+
case tn: TNode[?, ?] => tn.copyUntombed
608608
case _ => inode
609609
}
610610

0 commit comments

Comments
 (0)