Skip to content

let! is allowed outside of computation expressions #19345

@Lanayx

Description

@Lanayx
open System

let run () =
    let! x = Console.WriteLine("Hello world!")
    ()

run()

Expected behavior

Error FS0750 : This construct may only be used within computation expressions

Actual behavior

The code compiles and even runs without errors (let! x is ignored)

Known workarounds

Downgrade .NET SDK to .NET 8 (haven't checked on .NET 9)

Related information

Provide any related information (optional):

.NET SDK 10.0.102
Is not reproduced on .NET SDK 8.0.403

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions