Skip to content

Change compiler suggestion when not using return value of a function that returns a Task #18453

@MixaKonan

Description

@MixaKonan

Is your feature request related to a problem? Please describe.

I believe that the F# compiler is providing a wrong suggestion when ignoring (not meaning using |> ignore) a result of a function that returns a Task. Below is a comparison between C# and F#

C#:
Image

F#:
Image

The compiler is suggesting a default approach which is to either to pass the result into ignore function or to use actual bindings like let, which is inherently wrong and must not be suggested, because it is a very rare case, when one actually needs a fire-and-forget operation

Describe the solution you'd like

There must be a different suggestion when ignoring a result of Task returning functions. Something like in C#

Describe alternatives you've considered

None

Additional context

related: #1103

Add any other context or screenshots about the feature request here.

Example wrong behaviour:
Image

Example proper behaviour:
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions