Skip to content

Commit

Permalink
Avoid Dotty warning "final modifier is redundant for objects"
Browse files Browse the repository at this point in the history
  • Loading branch information
smarter committed Jan 29, 2019
1 parent cef5a73 commit 8aa67d7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/library/scala/collection/immutable/TreeSeqMap.scala
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@ final class TreeSeqMap[K, +V] private (
}
object TreeSeqMap extends MapFactory[TreeSeqMap] {
sealed trait OrderBy
final object OrderBy {
final case object Insertion extends OrderBy
final case object Modification extends OrderBy
object OrderBy {
case object Insertion extends OrderBy
case object Modification extends OrderBy
}

val Empty = new TreeSeqMap[Nothing, Nothing](Ordering.empty, HashMap.empty, 0, OrderBy.Insertion)
Expand Down Expand Up @@ -351,7 +351,7 @@ object TreeSeqMap extends MapFactory[TreeSeqMap] {
private val Mapping = Map

/* The ordering implementation below is an adapted version of immutable.IntMap. */
private[immutable] final object Ordering {
private[immutable] object Ordering {
import scala.collection.generic.BitOperations.Int._

@inline private[immutable] def toBinaryString(i: Int): String = s"$i/${i.toBinaryString}"
Expand Down Expand Up @@ -404,7 +404,7 @@ object TreeSeqMap extends MapFactory[TreeSeqMap] {
def empty[V]: Iterator[V] = Empty.asInstanceOf[Iterator[V]]
}

final case object Zero extends Ordering[Nothing] {
case object Zero extends Ordering[Nothing] {
// Important! Without this equals method in place, an infinite
// loop from Map.equals => size => pattern-match-on-Nil => equals
// develops. Case objects and custom equality don't mix without
Expand Down Expand Up @@ -635,4 +635,4 @@ object TreeSeqMap extends MapFactory[TreeSeqMap] {
else bin(prefix, mask, l, r)
}
}
}
}

0 comments on commit 8aa67d7

Please sign in to comment.