Skip to content

Missing FS0750 in nested let bang (got lost between 9.0 and 10.0) #19456

@Martin521

Description

@Martin521

A let! nested in a let binding used to produce error FS0750: This construct may only be used within computation expressions (in all SDKs from at least 5.0 up to 9.0), but no more in 10.0.

Example:

let y() =   // unit -> Task<Task<string array>>
    task {
        let a =
            let! b = System.IO.File.ReadAllLinesAsync("")
            b
        return a
    }

The let! in the fourth line is silently interpreted as a simple let, as you can see from the types of a, b and y.

(I do actually believe it should be properly compiled, but that is a separate issue. The first step is probably to bring the error message back.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-ComputationExpressionsEnd-to-end experience for computation expressions (except async and state machine compilation)Bug

    Type

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions