Skip to content

Commit

Permalink
Merge pull request scala#7964 from lrytz/itcc-followup
Browse files Browse the repository at this point in the history
Small cleanup after the IterableCC PR (7929)
  • Loading branch information
adriaanm authored Apr 3, 2019
2 parents df64638 + e72f1ac commit 63769af
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 12 deletions.
3 changes: 1 addition & 2 deletions src/library/scala/collection/IndexedSeq.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ package scala
package collection

import scala.annotation.tailrec
import scala.annotation.unchecked.uncheckedVariance
import scala.collection.Searching.{Found, InsertionPoint, SearchResult}
import scala.collection.Stepper.EfficientSplit
import scala.language.higherKinds
Expand All @@ -23,7 +22,7 @@ import scala.math.Ordering
/** Base trait for indexed sequences that have efficient `apply` and `length` */
trait IndexedSeq[+A] extends Seq[A]
with IndexedSeqOps[A, IndexedSeq, IndexedSeq[A]]
with IterableFactoryDefaults[A @uncheckedVariance, IndexedSeq] {
with IterableFactoryDefaults[A, IndexedSeq] {
@deprecatedOverriding("Compatibility override", since="2.13.0")
override protected[this] def stringPrefix: String = "IndexedSeq"

Expand Down
1 change: 0 additions & 1 deletion src/library/scala/collection/LinearSeq.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ package scala
package collection

import scala.annotation.tailrec
import scala.annotation.unchecked.uncheckedVariance
import scala.language.higherKinds

/** Base trait for linearly accessed sequences that have efficient `head` and
Expand Down
3 changes: 1 addition & 2 deletions src/library/scala/collection/Map.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
package scala
package collection

import scala.annotation.unchecked.uncheckedVariance
import scala.collection.generic.DefaultSerializable
import scala.collection.mutable.StringBuilder
import scala.language.higherKinds
Expand All @@ -23,7 +22,7 @@ import scala.util.hashing.MurmurHash3
trait Map[K, +V]
extends Iterable[(K, V)]
with MapOps[K, V, Map, Map[K, V]]
with MapFactoryDefaults[K, V @uncheckedVariance, Map, Iterable]
with MapFactoryDefaults[K, V, Map, Iterable]
with Equals {

def mapFactory: scala.collection.MapFactory[Map] = Map
Expand Down
4 changes: 1 addition & 3 deletions src/library/scala/collection/SeqMap.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

package scala.collection

import scala.annotation.unchecked.uncheckedVariance

/**
* A generic trait for ordered maps. Concrete classes have to provide
* functionality for the abstract methods in `SeqMap`.
Expand All @@ -32,7 +30,7 @@ import scala.annotation.unchecked.uncheckedVariance

trait SeqMap[K, +V] extends Map[K, V]
with MapOps[K, V, SeqMap, SeqMap[K, V]]
with MapFactoryDefaults[K, V @uncheckedVariance, SeqMap, Iterable] {
with MapFactoryDefaults[K, V, SeqMap, Iterable] {
override def mapFactory: MapFactory[SeqMap] = SeqMap
}

Expand Down
3 changes: 1 addition & 2 deletions src/library/scala/collection/SortedMap.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ package collection

import scala.annotation.implicitNotFound
import scala.language.higherKinds
import scala.annotation.unchecked.uncheckedVariance

/** A Map whose keys are sorted according to a [[scala.math.Ordering]]*/
trait SortedMap[K, +V]
extends Map[K, V]
with SortedMapOps[K, V, SortedMap, SortedMap[K, V]]
with SortedMapFactoryDefaults[K, V @uncheckedVariance, SortedMap, Iterable, Map]{
with SortedMapFactoryDefaults[K, V, SortedMap, Iterable, Map]{

def unsorted: Map[K, V] = this

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private[collection] case object SerializeEnd
*/
trait DefaultSerializable extends Serializable { this: scala.collection.Iterable[_] =>
protected[this] def writeReplace(): AnyRef = {
val f: Factory[Any, Any] = (this: scala.collection.Iterable[_]) match {
val f: Factory[Any, Any] = this match {
case it: scala.collection.SortedMap[_, _] => it.sortedMapFactory.sortedMapFactory[Any, Any](it.ordering.asInstanceOf[Ordering[Any]]).asInstanceOf[Factory[Any, Any]]
case it: scala.collection.Map[_, _] => it.mapFactory.mapFactory[Any, Any].asInstanceOf[Factory[Any, Any]]
case it: scala.collection.SortedSet[_] => it.sortedIterableFactory.evidenceIterableFactory[Any](it.ordering.asInstanceOf[Ordering[Any]])
Expand Down
1 change: 0 additions & 1 deletion src/library/scala/collection/immutable/Vector.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ package scala
package collection
package immutable

import scala.annotation.unchecked.uncheckedVariance
import scala.collection.Stepper.EfficientSplit
import scala.collection.generic.DefaultSerializable
import scala.collection.mutable.ReusableBuilder
Expand Down

0 comments on commit 63769af

Please sign in to comment.