Skip to content

Commit 16c07f4

Browse files
authored
Merge pull request scala/scala#8985 from NthPortal/topic/ll-cons-laziness/PR
Increase laziness of #:: for LazyList
2 parents ccb00b4 + 3d54373 commit 16c07f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/src/scala/collection/immutable/LazyList.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,7 @@ object LazyList extends SeqFactory[LazyList] {
11171117
/** Construct a LazyList consisting of a given first element followed by elements
11181118
* from another LazyList.
11191119
*/
1120-
def #:: [B >: A](elem: => B): LazyList[B] = newLL(sCons(elem, l()))
1120+
def #:: [B >: A](elem: => B): LazyList[B] = newLL(sCons(elem, newLL(l().state)))
11211121
/** Construct a LazyList consisting of the concatenation of the given LazyList and
11221122
* another LazyList.
11231123
*/

0 commit comments

Comments
 (0)