Skip to content

Commit 241500e

Browse files
committed
Remove unnecessary implicit definitions
Since Factory is now a transparent type alias to CanBuildFrom, we don’t need anymore conversions from CanBuildFrom to Factory.
1 parent e1aa033 commit 241500e

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

compat/src/main/scala-2.11_2.12/scala/collection/compat/PackageShared.scala

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ private[compat] trait PackageShared {
1616
* @tparam A Type of elements (e.g. `Int`, `Boolean`, etc.)
1717
* @tparam C Type of collection (e.g. `List[Int]`, `TreeMap[Int, String]`, etc.)
1818
*/
19-
type Factory[-A, +C] = CanBuildFrom[Nothing, A, C] // Ideally, this would be an opaque type
19+
type Factory[-A, +C] = CanBuildFrom[Nothing, A, C]
2020

2121
implicit class FactoryOps[-A, +C](private val factory: Factory[A, C]) {
2222

@@ -32,13 +32,6 @@ private[compat] trait PackageShared {
3232
def newBuilder: m.Builder[A, C] = factory()
3333
}
3434

35-
implicit def fromCanBuildFrom[A, C](implicit cbf: CanBuildFrom[Nothing, A, C]): Factory[A, C] =
36-
cbf.asInstanceOf[Factory[A, C]]
37-
38-
implicit def fromCanBuildFromConversion[X, A, C](x: X)(
39-
implicit toCanBuildFrom: X => CanBuildFrom[Nothing, A, C]): Factory[A, C] =
40-
fromCanBuildFrom(toCanBuildFrom(x))
41-
4235
implicit def genericCompanionToCBF[A, CC[X] <: GenTraversable[X]](
4336
fact: GenericCompanion[CC]): CanBuildFrom[Any, A, CC[A]] =
4437
simpleCBF(fact.newBuilder[A])

0 commit comments

Comments
 (0)