Skip to content

Commit a92e444

Browse files
committed
Better fix for LazyListIterable problem
Better fix for LazyListIterable problem as suggested by Nguyen
1 parent 484137c commit a92e444

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/src/scala/collection/immutable/LazyListIterable.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ final class LazyListIterable[+A] private (lazyState: LazyListIterable.EmptyMarke
311311
throw new RuntimeException(
312312
"LazyListIterable evaluation depends on its own result (self-reference); see docs for more info")
313313

314-
val fun = _tail.asInstanceOf[() ->{this} LazyListIterable[A]^]
314+
val fun = _tail.asInstanceOf[() ->{this} LazyListIterable[A]^{this}]
315315
_tail = MidEvaluation
316316
val l =
317317
// `fun` returns a LazyListIterable that represents the state (head/tail) of `this`. We call `l.evaluated` to ensure
@@ -321,7 +321,7 @@ final class LazyListIterable[+A] private (lazyState: LazyListIterable.EmptyMarke
321321
try fun().evaluated
322322
// restore `fun` in finally so we can try again later if an exception was thrown (similar to lazy val)
323323
finally _tail = fun
324-
_tail = caps.unsafe.unsafeAssumePure(l.rawTail)
324+
_tail = l.rawTail
325325
_head = l.rawHead
326326
}
327327
}

0 commit comments

Comments
 (0)