You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Needs a restarr to work!
The forwarder / alias `IterableOnceOps./:` uses `@nullOut` to clear
the `this` reference before calling `foldLeft`. The annotation is
also on the method itself to ensure mixin forwarders (generated in
the subclass) and the static mixin accessor (generated in the trait)
null out the receiver before invoking `/:`.
After removing `LazyList.foldLeft`, it inherits the implementation
from LinearSeqOps. That method again uses `@nullOut` twice, once
to clear `this` when it's no longer needed, and once on the method
for the generated accessors.
I think we should *not* use `@nullOut` everywhere in the standard
library, only on methods that cannot be overridden in LazyList, like
`/:`.
`@nullOut` works correctly on `mkString` too, but unfortunately the
`addString` override in LazyList prevents GC of processed elements
due to cycle detection.
0 commit comments