Skip to content

Foldable.iterateRight is not sound #1973

Description

@johnynek

similar to #1716 I think Foldable.iterateRight will break if Eval.always are always used.

I think the fix is that we must accept an Iterable[A] rather than Iterator[A] and call .iterator internally. Basically add a Eval.always(iter.iterator).flatMap { ... } and I think it should be safe.

Of course, we need to demonstrate the problem with a failing test first.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions