dotnet / dotnet/fsharp

Crash in VS when trying to wrap very large function body in 'async{...}'

Open
#12,752 1 comment 2 reactions 0 assignees View on GitHub
Area-ComputationExpressions Feature Improvement Impact-Low
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

Putting an enormous block of code inside 'async{...}' causes a crash (probably in the parser).

**Repro steps**

Make a new F# Console App in VS2022 Community edition
replace the Program.fs contents with this file:
https://github.com/brianmcn/Zelda1RandoTools/blob/f9db8d6878b018910131ef9a3e1fd321cdaa822a/Z1R_Tracker/Z1R_WPF/WPFUI.fs
find the function makeAll() on line 137
try to add 'async{' at the end of the line (intending to put entire 3000-line function body inside async{...})

**Expected behavior**

No crash/hang

**Actual behavior**

VS immediately becomes unresponsive and then crashes

**Known workarounds**

I refactored the giant function so it was no longer 3000 lines long (now it's only about 1500, and everything works fine).
Fixing this bug is not a big deal to me, just an FYI.

**Related information**

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.