Skip to content

Preserve resumable state-machine lowering in Debug - #20469

Draft
majocha wants to merge 3 commits into
dotnet:mainfrom
majocha:majocha-issue-20466-state-machine-debug-investig
Draft

Preserve resumable state-machine lowering in Debug#20469
majocha wants to merge 3 commits into
dotnet:mainfrom
majocha:majocha-issue-20466-state-machine-debug-investig

Conversation

@majocha

@majocha majocha commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Fixes #20466

Debug compilation could route inline builders containing low-level resumable state machines through generated helper methods. That helper boundary hid nested ResumableCode definitions from lowering, causing incorrect execution for composed builders such as TaskSeq. Keep resumable inline expansions in the caller's expression tree while preserving the existing helper specialization for ordinary inline methods.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

❗ Release notes required

You can open this PR in browser to add release notes: open in github.dev


✅ Found changes and release notes in following paths:

Warning

No PR link found in some release notes, please consider adding it.

Change path Release notes path Description
`src/Compiler` docs/release-notes/.FSharp.Compiler.Service/11.0.100.md No current pull request URL (#20469) found, please consider adding it

@majocha

majocha commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

The idea is to preserve the exact behavior of from before #19548. Resumable code lowers to static branch whenever possible even in debug.

@T-Gro
T-Gro requested a review from auduchinok September 7, 2026 09:52
@majocha

majocha commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

This is AI generated and clearly fails regression tests.
The gist of the problem is forcing a resumable state machine that for whatever reason has no dynamic implementation into dynamic path. This is a breaking change at least wrt debugging.

@T-Gro

T-Gro commented Sep 9, 2026

Copy link
Copy Markdown
Member

This is a breaking change at least wrt debugging.

This is a break we can take in order to make the fix.
That way, we at least motivate people to test runtime async sooner :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

Incorrect state machine compilation in debug

2 participants