Skip to content

Optimizer: fix accessing captured values when skipping inlining - #20089

Merged
T-Gro merged 1 commit into
dotnet:mainfrom
auduchinok:optimizer-noInline-accessCaptured
Aug 12, 2026
Merged

Optimizer: fix accessing captured values when skipping inlining#20089
T-Gro merged 1 commit into
dotnet:mainfrom
auduchinok:optimizer-noInline-accessCaptured

Conversation

@auduchinok

@auduchinokauduchinok commented Jul 28, 2026

Copy link
Copy Markdown
Member

Fixes the captured values repro from #20063.

letf()=letx=42let inlineg y = x + int y
g 1uy
printfn "%A (expected 43)"(f ())
letf2()=letxs=[1;2;3]let inlineg y = xs |> List.map (fun v -> v + int y)|> List.sum
g 1uy
printfn "%A (expected 9)"(f2 ())

@auduchinok
auduchinok requested a review from a team as a code ownerJuly 28, 2026 14:43
@auduchinokauduchinok added the NO_RELEASE_NOTES Label for pull requests which signals, that user opted-out of providing release notes label Jul 28, 2026
@github-actionsgithub-actionsBot added AI-Tooling-Check-Scanned-Clean Tooling check: diff analyzed, no interesting infrastructure files ⚠️ Affects-Compiler-Output Tooling check: PR touches IL emission or codegen labels Jul 28, 2026
@github-actions

This comment has been minimized.

@github-project-automationgithub-project-automationBot moved this from New to In Progress in F# Compiler and ToolingAug 3, 2026
@T-Gro
T-Gro enabled auto-merge (squash) August 3, 2026 19:10
auto-merge was automatically disabled August 10, 2026 10:12

Head branch was pushed to by a user without write access

@auduchinok
auduchinokforce-pushed the optimizer-noInline-accessCaptured branch from 6f53591 to ae4fe1bCompareAugust 10, 2026 10:12
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Release notes required, but author opted out

Warning

Author opted out of release notes, check is disabled for this pull request.
cc @dotnet/fsharp-team-msft

@auduchinok

Copy link
Copy Markdown
MemberAuthor

This is ready.

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Tooling Safety Check — Affects-Compiler-Output
Affects-Compiler-Output: modifies Optimizer.fs (IL output)

Generated by PR Tooling Safety Check · opus46 5.7M ·

@T-Gro

Copy link
Copy Markdown
Member

/backport to release/10.0.4xx

Resurfaced as #20297 against SDK 10.0.400 — AccessViolationException when an inline function is applied inside a nested closure in a Debug build. That branch has #19548 but not this fix. The cherry-pick applies cleanly, the repro passes with it, and the DebugInlineAsCall suite is green there (79/79). #20299 adds a regression test for that callsite shape and is worth taking along.

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/10.0.4xx (link to workflow run)

@T-Gro

Copy link
Copy Markdown
Member

/backport to release/dev18.9

@T-Gro

Copy link
Copy Markdown
Member

/backport to release/dev18.10

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/dev18.9 (link to workflow run)

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/dev18.10 (link to workflow run)

@github-actions

Copy link
Copy Markdown
Contributor

@T-Gro an error occurred while backporting to release/dev18.10. See the workflow output for details.

@github-actions

Copy link
Copy Markdown
Contributor

@T-Gro an error occurred while backporting to release/dev18.9. See the workflow output for details.

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

Labels

⚠️ Affects-Compiler-OutputTooling check: PR touches IL emission or codegenAI-Tooling-Check-Scanned-CleanTooling check: diff analyzed, no interesting infrastructure filesNO_RELEASE_NOTESLabel for pull requests which signals, that user opted-out of providing release notes

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants

@auduchinok@T-Gro