Skip to content

do! on partially applied function shows no error in Ionide #2108

@tforkmann

Description

@tforkmann

Describe the bug

Ionide doesn’t show any warning or diagnostic when using do! with a partially applied function that is missing required parameters.
The expression type-checks as a function (not a Task or Async), but the IDE still allows it silently, even though the F# compiler raises an FS0041 error at build time.

Steps to reproduce

task {
    do! JobsStorage.createFinishContractJob contract.ContractID (Some deadline)
}

with 
val createFinishContractJob :
    contractID: ContractID ->
    deadline: option<DateTimeOffset> ->
    createdByUser: option<string> ->
    Task<unit>

Expected

task {
    do! JobsStorage.createFinishContractJob contract.ContractID (Some deadline) None
}

No warning or squiggle is shown.
Ionide’s type checker accepts the code silently until dotnet build, which fails with:

error FS0041: No overload for method 'Bind' matches ...

Link to sample reproduction

Expected behaviour

Ionide should highlight or hint that parameters are missing —
e.g. show a squiggle or tooltip such as:
'do!' expects an awaitable expression (Task/Async), but this is a function missing arguments.

It works for let! _ =

Screenshots

Image Image

Machine infos

  • OS: Mac
  • .NET SDK version: 9.0.305
  • Ionide version: latest

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions