Skip to content

Commit 68c1e38

Browse files
committed
fix IsIterableLike example code
- use IterableOps instead of IterableLike. IterableLike does not exists - use iterator instead of toIterator https://github.com/scala/scala/blob/d94d9bc334de165bcdbefcf29ae05d8542549c4b/src/library/scala/collection/IterableOnce.scala#L80-L81
1 parent 9335974 commit 68c1e38

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/library/scala/collection/generic/IsIterableLike.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ import scala.reflect.ClassTag
2828
* `String`.
2929
*
3030
* {{{
31-
* import scala.collection.Iterable
31+
* import scala.collection.{Iterable, IterableOps}
3232
* import scala.collection.generic.IsIterableLike
3333
*
34-
* class ExtensionMethods[A, Repr](coll: IterableLike[A, Repr]) {
34+
* class ExtensionMethods[A, Repr](coll: IterableOps[A, Iterable, Repr]) {
3535
* def mapReduce[B](mapper: A => B)(reducer: (B, B) => B): B = {
36-
* val iter = coll.toIterator
36+
* val iter = coll.iterator
3737
* var res = mapper(iter.next())
3838
* while (iter.hasNext)
3939
* res = reducer(res, mapper(iter.next()))

0 commit comments

Comments
 (0)