From 421eba4742d2794a88f05cfde28e8476a02f4777 Mon Sep 17 00:00:00 2001 From: xuwei-k <6b656e6a69@gmail.com> Date: Sun, 7 Dec 2025 20:37:14 +0900 Subject: [PATCH] Update IsIterable scaladoc use `extension` and `using` instead of `implicit` --- library/src/scala/collection/generic/IsIterable.scala | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/library/src/scala/collection/generic/IsIterable.scala b/library/src/scala/collection/generic/IsIterable.scala index 2e5c7999fd92..9f1b9d122243 100644 --- a/library/src/scala/collection/generic/IsIterable.scala +++ b/library/src/scala/collection/generic/IsIterable.scala @@ -41,10 +41,9 @@ import caps.unsafe.untrackedCaptures * `String`. * * {{{ - * import scala.collection.{Iterable, IterableOps} * import scala.collection.generic.IsIterable * - * class ExtensionMethods[Repr, I <: IsIterable[Repr]](coll: Repr, it: I) { + * extension [Repr, I <: IsIterable[Repr]](coll: Repr)(using it: I) { * def mapReduce[B](mapper: it.A => B)(reducer: (B, B) => B): B = { * val iter = it(coll).iterator * var res = mapper(iter.next()) @@ -54,9 +53,6 @@ import caps.unsafe.untrackedCaptures * } * } * - * implicit def withExtensions[Repr](coll: Repr)(implicit it: IsIterable[Repr]): ExtensionMethods[Repr, it.type] = - * new ExtensionMethods(coll, it) - * * // See it in action! * List(1, 2, 3).mapReduce(_ * 2)(_ + _) // res0: Int = 12 * "Yeah, well, you know, that's just, like, your opinion, man.".mapReduce(x => 1)(_ + _) // res1: Int = 59 @@ -88,10 +84,6 @@ import caps.unsafe.untrackedCaptures * (See the `IsIterable` companion object, which contains a precise * specification of the available implicits.) * - * ''Note'': Currently, it's not possible to combine the implicit conversion and - * the class with the extension methods into an implicit class due to - * limitations of type inference. - * * ===Implementing `IsIterable` for New Types=== * * One must simply provide an implicit value of type `IsIterable`