Skip to content

Computation expressions desugar do! in final positions to *Final methods #20448

Closed

Description

@majocha

Very bad decision in hindsight.

Theoretically it allows for recursion like this:

let rec loop n  = task {
    do! doWork n
    if n > 0 then
        do! loop (n - 1)
    }

In iterators it causes troubles / type errors failing to find a sensible overload when Bind works on different type shapes than Yield and YieldFrom, e.g:

taskSeq {
    yield 1
    do! cleanup
}

See also the nonsense here https://github.com/fsprojects/FSharp.Control.TaskSeq/pull/310/changes

Activity

  1. added theissue type on Sep 4, 2026
  2. added this to the Backlog milestone on Sep 4, 2026
  3. added
    Area-ComputationExpressions
    and removed on Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-ComputationExpressionsBug

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions