diff options
author | Rex Kerr <ichoran@gmail.com> | 2015-08-30 17:50:26 -0700 |
---|---|---|
committer | Rex Kerr <ichoran@gmail.com> | 2015-08-30 17:50:26 -0700 |
commit | 2c5199520b1c89a6b1e2bfbc734d0ceb620723a1 (patch) | |
tree | f3c787105e3386201d8f53ea0560d09b4b3e9f58 /src/library | |
parent | 4f35ab77e6b4456025facc63297e7f2e93c2b9d0 (diff) | |
download | scala-2c5199520b1c89a6b1e2bfbc734d0ceb620723a1.tar.gz scala-2c5199520b1c89a6b1e2bfbc734d0ceb620723a1.tar.bz2 scala-2c5199520b1c89a6b1e2bfbc734d0ceb620723a1.zip |
SI-8647 Used immutable scheme for mutable.BitSet to resolve canBuildFrom
mutable.BitSet had a conflict between its own implicit canBuildFrom and the one inherited from SortedSetFactory in mutable.SortedSet.
The immutable hierarchy already had a workaround; this just copies it on the mutable side.
Test written to verify compilation.
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/collection/mutable/SortedSet.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/library/scala/collection/mutable/SortedSet.scala b/src/library/scala/collection/mutable/SortedSet.scala index 3dee57eb6d..304469916d 100644 --- a/src/library/scala/collection/mutable/SortedSet.scala +++ b/src/library/scala/collection/mutable/SortedSet.scala @@ -43,10 +43,12 @@ trait SortedSet[A] extends scala.collection.SortedSet[A] with scala.collection.S * */ object SortedSet extends MutableSortedSetFactory[SortedSet] { - implicit def canBuildFrom[A](implicit ord: Ordering[A]): CanBuildFrom[Coll, A, SortedSet[A]] = new SortedSetCanBuildFrom[A] + def canBuildFrom[A](implicit ord: Ordering[A]): CanBuildFrom[Coll, A, SortedSet[A]] = new SortedSetCanBuildFrom[A] def empty[A](implicit ord: Ordering[A]): SortedSet[A] = TreeSet.empty[A] + // Force a declaration here so that BitSet (which does not inherit from SortedSetFactory) can be more specific + override implicit def newCanBuildFrom[A](implicit ord : Ordering[A]): CanBuildFrom[Coll, A, SortedSet[A]] = super.newCanBuildFrom } /** Explicit instantiation of the `SortedSet` trait to reduce class file size in subclasses. */ |