Preserve extension SRTP witnesses across files and inline calls by T-Gro · Pull Request #20717 · dotnet/fsharp · GitHub
Skip to content

Preserve extension SRTP witnesses across files and inline calls - #20717

Merged
T-Gro merged 8 commits into
mainfrom
t-gro-extension-srtp-fixes
Oct 9, 2026
Merged

T-Gro merged 8 commits into
mainfrom
t-gro-extension-srtp-fixes

Conversation

@T-Gro

@T-Gro T-Gro commented Oct 6, 2026

Copy link
Copy Markdown
Member

Description

Fixes #20683
Fixes #20684
Fixes #20685

Inline calls keep their extension constraints and selected witnesses. Generic extension forwarding also compiles without optimization.

Checklist

  • Test cases added

  • Performance benchmarks added in case of performance changes

  • Release notes entry updated:

    Please make sure to add an entry with short succinct description of the change as well as link to this pull request to the respective release notes file, if applicable.

    Release notes files:

    • If anything under src/Compiler has been changed, please make sure to make an entry in docs/release-notes/.FSharp.Compiler.Service/<version>.md, where <version> is usually "highest" one, e.g. 42.8.200
    • If language feature was added (i.e. LanguageFeatures.fsi was changed), please add it to docs/release-notes/.Language/preview.md
    • If a change to FSharp.Core was made, please make sure to edit docs/release-notes/.FSharp.Core/<version>.md where version is "highest" one, e.g. 8.0.200.

    Information about the release notes entries format can be found in the documentation.
    Example:

    If you believe that release notes are not necessary for this PR, please add NO_RELEASE_NOTES label to the pull request.

Fixes #20683
Fixes #20684
Fixes #20685

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

@T-Gro T-Gro left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These deletions remove source-position replay from the August implementation in #19602. RFC FS-1043 remains supported.

Comment thread src/Compiler/Checking/ConstraintSolver.fs
Comment thread src/Compiler/Checking/ConstraintSolver.fs
Comment thread src/Compiler/Checking/ConstraintSolver.fs
Comment thread src/Compiler/Optimize/Optimizer.fs
Comment thread src/Compiler/Optimize/Optimizer.fs
Comment thread src/Compiler/TypedTree/TcGlobals.fs
Comment thread src/Compiler/Checking/TraitConstraintScope.fs
Keep exception-safe rollback. Refresh the exact neg45 baseline and run the existing case on every runtime and in Debug.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@T-Gro
T-Gro requested a review from abonie October 7, 2026 13:40

@T-Gro T-Gro left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 🕵️ LGTM

@T-Gro T-Gro added the AI-reviewed PR reviewed by AI review council label Oct 7, 2026
@T-Gro

T-Gro commented Oct 7, 2026

Copy link
Copy Markdown
Member Author

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@github-project-automation github-project-automation Bot moved this from New to In Progress in F# Compiler and Tooling Oct 8, 2026
@abonie
abonie self-requested a review October 8, 2026 12:12
Comment thread src/Compiler/Optimize/Optimizer.fs Outdated
Keep intrinsic candidates separate from scope-provided operators. Prefer applicable primitive built-ins while preserving heterogeneous extension solutions and witness transport.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@T-Gro
T-Gro requested a review from abonie October 8, 2026 13:18
T-Gro and others added 3 commits October 8, 2026 15:41
Use a struct tuple instead of an anonymous struct record for the internal lookup result. Preserve candidate origin, order and built-in arbitration without adding generated public types or changing the API baseline.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Captured scope does not identify the selected witnesses. Reuse the existing no-trait classification for cache eligibility and preserve the separate recursion guard. Cover both specialization orders in the existing competing-witness theory.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@T-Gro
T-Gro requested a review from abonie October 9, 2026 09:45
@T-Gro
T-Gro merged commit 6cde2b1 into main Oct 9, 2026
55 checks passed
@T-Gro

T-Gro commented Oct 9, 2026

Copy link
Copy Markdown
Member Author

/backport to release/11.0.1xx-rc2

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Started backporting to release/11.0.1xx-rc2 (link to workflow run)

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

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

Labels

AI-reviewed PR reviewed by AI review council

Projects

Archived in project

2 participants