Skip to content

Fix recursive inline member ordering in optimizer - #20111

Merged
T-Gro merged 54 commits into
dotnet:mainfrom
majocha:fix-20085
Sep 16, 2026
Merged

T-Gro merged 54 commits into
dotnet:mainfrom
majocha:fix-20085

Conversation

@majocha

@majocha majocha commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Recursive inline members in a recursive binding group can depend on siblings that appear later in source order. The optimizer now discovers these dependencies, optimizes bindings in dependency order, and restores source order before emitting the result. Trait-witness dependencies and module-level recursive groups are handled as well, while non-inline recursive groups retain the existing behavior.

Regression coverage exercises recursive inline member access, trait-witness resolution, and the existing Issue 1565 cases. Emitted-IL and AOT baselines are updated for the resulting stable output.

Fixes #1565

majocha and others added 8 commits August 1, 2026 13:12
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
majocha and others added 12 commits August 2, 2026 09:41
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

✅ No release notes required

@majocha

majocha commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

It works. I'll mark as ready for review but I'm not sure the approach here is the best.

@github-actions

This comment has been minimized.

majocha added 12 commits August 27, 2026 22:02
A single nested ModuleOrNamespaceBinding.Module element previously disabled
the dependency-first optimization schedule for the entire recursive group,
so a non-inline binding forward-referencing an inline sibling (directly, or
through vals in a later nested module) still failed with FS1114/FS1118.

Generalize the schedule to group elements: a nested module publishes all of
its contained vals, and both sides of the dependency edge (bindings that
reference a nested module's vals, and modules whose contents reference
sibling bindings) are tracked.
@github-actions

This comment has been minimized.

@T-Gro

T-Gro commented Sep 8, 2026

Copy link
Copy Markdown
Member

@copilot resolve the merge conflicts in this pull request

@github-project-automation github-project-automation Bot moved this from New to In Progress in F# Compiler and Tooling Sep 8, 2026
@T-Gro
T-Gro enabled auto-merge (squash) September 8, 2026 07:54
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

🔍 Tooling Safety Check — Affects-Compiler-Output
Affects-Compiler-Output: Optimizer changes can alter emitted compiler output.

Generated by PR Tooling Safety Check · gpt56 2.1M ·

auto-merge was automatically disabled September 12, 2026 07:57

Head branch was pushed to by a user without write access

@T-Gro
T-Gro merged commit ee6804b into dotnet:main Sep 16, 2026
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚠️ Affects-Bootstrap Tooling check: PR touches compiler bootstrap chain ⚠️ Affects-Compiler-Output Tooling check: PR touches IL emission or codegen AI-reviewed PR reviewed by AI review council AI-Tooling-Check-Scanned-Clean Tooling check: diff analyzed, no interesting infrastructure files

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Improve diagnostics for inlining in class methods - FS1114, FS1113, FS1116, FS1118

2 participants