Skip to content

Commit 8d42211

Browse files
committed
Fix remaining cc errors
1 parent 63d3084 commit 8d42211

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

library/src/scala/collection/convert/AsScalaConverters.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ trait AsScalaConverters {
4343
*/
4444
def asScala[A](i: ju.Iterator[A] | Null): Iterator[A] | Null = i match {
4545
case null => null
46-
case wrapper: IteratorWrapper[A @uc] => wrapper.underlying
46+
case wrapper: IteratorWrapper[A @uc] => wrapper.underlying.unsafeAssumePure // TODO: Remove when pattern matching recognizes this is safe
4747
case _ => new JIteratorWrapper(i.nn)
4848
}
4949

@@ -61,7 +61,7 @@ trait AsScalaConverters {
6161
*/
6262
def asScala[A](e: ju.Enumeration[A] | Null): Iterator[A] | Null = e match {
6363
case null => null
64-
case wrapper: IteratorWrapper[A @uc] => wrapper.underlying
64+
case wrapper: IteratorWrapper[A @uc] => wrapper.underlying.unsafeAssumePure // TODO: Remove when pattern matching recognizes this is safe
6565
case _ => new JEnumerationWrapper(e.nn)
6666
}
6767

@@ -79,7 +79,7 @@ trait AsScalaConverters {
7979
*/
8080
def asScala[A](i: jl.Iterable[A] | Null): Iterable[A] | Null = i match {
8181
case null => null
82-
case wrapper: IterableWrapper[A @uc] => wrapper.underlying
82+
case wrapper: IterableWrapper[A @uc] => wrapper.underlying.unsafeAssumePure // TODO: Remove when pattern matching recognizes this is safe
8383
case _ => new JIterableWrapper(i.nn)
8484
}
8585

@@ -94,7 +94,7 @@ trait AsScalaConverters {
9494
*/
9595
def asScala[A](c: ju.Collection[A] | Null): Iterable[A] | Null = c match {
9696
case null => null
97-
case wrapper: IterableWrapper[A @uc] => wrapper.underlying
97+
case wrapper: IterableWrapper[A @uc] => wrapper.underlying.unsafeAssumePure // TODO: Remove when pattern matching recognizes this is safe
9898
case _ => new JCollectionWrapper(c.nn)
9999
}
100100

library/src/scala/collection/immutable/HashMap.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2202,7 +2202,7 @@ object HashMap extends MapFactory[HashMap] {
22022202
def empty[K, V]: HashMap[K, V] =
22032203
EmptyMap.asInstanceOf[HashMap[K, V]]
22042204

2205-
def from[K, V](source: collection.IterableOnce[(K, V)]): HashMap[K, V] =
2205+
def from[K, V](source: collection.IterableOnce[(K, V)]^): HashMap[K, V] =
22062206
source match {
22072207
case hs: HashMap[K, V] => hs
22082208
case _ => (newBuilder[K, V] ++= source).result()

library/src/scala/collection/mutable/HashSet.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,10 @@ final class HashSet[A](initialCapacity: Int, loadFactor: Double)
243243
override def stepper[S <: Stepper[_]](implicit shape: StepperShape[A, S]): S with EfficientSplit = {
244244
import convert.impl._
245245
val s = shape.shape match {
246-
case StepperShape.IntShape => new IntTableStepper[Node[A]] (size, table, _.nn.next.nn, _.key.asInstanceOf[Int], 0, table.length)
247-
case StepperShape.LongShape => new LongTableStepper[Node[A]] (size, table, _.nn.next.nn, _.key.asInstanceOf[Long], 0, table.length)
248-
case StepperShape.DoubleShape => new DoubleTableStepper[Node[A]](size, table, _.nn.next.nn, _.key.asInstanceOf[Double], 0, table.length)
249-
case _ => shape.parUnbox(new AnyTableStepper[A, Node[A]](size, table, _.nn.next.nn, _.key, 0, table.length))
246+
case StepperShape.IntShape => new IntTableStepper[Node[A]] (size, table, _.next.nn, _.key.asInstanceOf[Int], 0, table.length)
247+
case StepperShape.LongShape => new LongTableStepper[Node[A]] (size, table, _.next.nn, _.key.asInstanceOf[Long], 0, table.length)
248+
case StepperShape.DoubleShape => new DoubleTableStepper[Node[A]](size, table, _.next.nn, _.key.asInstanceOf[Double], 0, table.length)
249+
case _ => shape.parUnbox(new AnyTableStepper[A, Node[A]](size, table, _.next.nn, _.key, 0, table.length))
250250
}
251251
s.asInstanceOf[S with EfficientSplit]
252252
}

library/src/scala/collection/mutable/LongMap.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,18 +469,18 @@ final class LongMap[V] private[collection] (defaultEntry: Long -> V, initialBuff
469469
}
470470

471471
@deprecated("Use ++ with an explicit collection argument instead of + with varargs", "2.13.0")
472-
override def + [V1 >: V](elem1: (Long, V1), elem2: (Long, V1), elems: (Long, V1)*): LongMap[V1] = {
472+
override def + [V1 >: V](elem1: (Long, V1), elem2: (Long, V1), elems: (Long, V1)*): LongMap[V1]^{} = {
473473
val m = this + elem1 + elem2
474474
if(elems.isEmpty) m else m.concat(elems)
475475
}
476476

477-
override def concat[V1 >: V](xs: scala.collection.IterableOnce[(Long, V1)]): LongMap[V1] = {
477+
override def concat[V1 >: V](xs: scala.collection.IterableOnce[(Long, V1)]^): LongMap[V1] = {
478478
val lm = clone().asInstanceOf[LongMap[V1]]
479479
xs.iterator.foreach(kv => lm += kv)
480480
lm
481481
}
482482

483-
override def ++ [V1 >: V](xs: scala.collection.IterableOnce[(Long, V1)]): LongMap[V1] = concat(xs)
483+
override def ++ [V1 >: V](xs: scala.collection.IterableOnce[(Long, V1)]^): LongMap[V1] = concat(xs)
484484

485485
@deprecated("Use m.clone().addOne(k,v) instead of m.updated(k, v)", "2.13.0")
486486
override def updated[V1 >: V](key: Long, value: V1): LongMap[V1] =

0 commit comments

Comments
 (0)