Skip to content

Bug: TaskSeq.item and tryItem should NOT read past the found item, not even a little bit #65

@abelbraaksma

Description

@abelbraaksma

Consider this:

task {
    let mutable i = 0

    let ts = taskSeq {
        i <- i + 1
        yield 1
        i <- i + 1
        yield 2
        i <- i + 1 // we should never get here, if we pick idx 1
    }

    do! ts |> TaskSeq.item 1
    printfn "%i" i
}

This prints "3", not "2". That's wrong. Side effects beyond the item found should not execute.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions