Skip to content

Commit b284afc

Browse files
committed
Revert "Fixes Iterable#toString forcing elements"
This reverts commit 129e3a7 (pull request scala/scala#8554). See discussion on scala/scala-dev#671
1 parent 8f04f7d commit b284afc

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

library/src/scala/collection/Iterable.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ trait Iterable[+A] extends IterableOnce[A]
6868
protected[this] def stringPrefix: String = "Iterable"
6969

7070
/** Converts this $coll to a string.
71+
*
72+
* @return a string representation of this collection. By default this
73+
* string consists of the `className` of this $coll, followed
74+
* by all elements separated by commas and enclosed in parentheses.
7175
*/
72-
override def toString: String =
73-
this match {
74-
case _: StrictOptimizedIterableOps[_, _, _] => mkString(className + "(", ", ", ")")
75-
case _ => className + (if (isEmpty) "()" else "(<iterable>)")
76-
}
76+
override def toString = mkString(className + "(", ", ", ")")
7777

7878
/** Analogous to `zip` except that the elements in each collection are not consumed until a strict operation is
7979
* invoked on the returned `LazyZip2` decorator.

library/src/scala/collection/concurrent/TrieMap.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,6 @@ final class TrieMap[K, V] private (r: AnyRef, rtupd: AtomicReferenceFieldUpdater
10021002
else cachedSize()
10031003
override def isEmpty: Boolean = size == 0
10041004
override protected[this] def className = "TrieMap"
1005-
override def toString: String = mkString(className + "(", ", ", ")")
10061005

10071006
}
10081007

0 commit comments

Comments
 (0)