dotnet / dotnet/fsharp

Variable in scope is not visible after a bang!-operation in CE

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

Description

[Repro.zip](https://github.com/dotnet/fsharp/files/8898420/Repro.zip)

At least in the async CE, after a monadic operation (let!/do!/match! etc.), variables in the debugger suddenly seem to go out of scope:

```f#
module Program =

let f x =
async {
do! async.Return ()
return 1
}

[]
let main _argv =
f 0 |> Async.RunSynchronously |> printfn "%A"
0
```

![image](https://user-images.githubusercontent.com/7766733/173544086-7b70c3f8-ff18-4bbc-af16-d32dd502456d.png)

![image1](https://user-images.githubusercontent.com/7766733/173544119-adc9da09-e913-411e-b50a-ad000c5113eb.png)

(Screenshots from Rider. Originally [reported there](https://youtrack.jetbrains.com/issue/RIDER-78577), but was redirected here.)

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.