dotnet / dotnet/fsharp

Breakpoint on `()` in if branch in async CE not hit

Open
#19,094 0 comments 0 reactions 0 assignees View on GitHub
Area-Debug Bug
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 22h
Merged PRs (30d)
144

Description

**Repro steps**

Write the following console app, place a breakpoint on `()`, and debug it (in debug mode):

```fsharp
let c x =
async {
if x = "" then
()
}

c "" |> Async.RunSynchronously
```

**Expected behavior**

The breakpoint is hit.

**Actual behavior**

No breakpoint is hit.

**Known workarounds**

Replace `()` by e.g. `ignore 0`.

**Related information**

- .NET SDK 9

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.