Add nullness regression test for recursive inline SRTP memoization - #20247
Open
T-Gro wants to merge 6 commits into
Open
Add nullness regression test for recursive inline SRTP memoization#20247T-Gro wants to merge 6 commits into
T-Gro wants to merge 6 commits into
Conversation
The function-domain unification order change in PR #15181 (nullness) caused recursive inline SRTP resolution to be truncated by one currying level: an inference variable still carrying an unsolved member constraint could be absorbed by the required domain, merging away the pending recursive trait resolution. This regressed patterns such as FSharpPlus `memoizeN`. SolveFunTypeEqn now keeps the SRTP-constrained inference variable as the unification representative for that specific case, and only when not MatchingOnly (mirroring SolveTypeEqualsType). Adds two ComponentTests (the memoizeN repro across currying depths, and a MatchingOnly overload-resolution guard) and repoints the FSharpPlus regression matrix at a minimal global.json-bump branch that exercises the fix end-to-end. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4cfb1c86-0d7e-45e6-9529-3c5f301c0912
Contributor
✅ No release notes required |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4cfb1c86-0d7e-45e6-9529-3c5f301c0912
T-Gro
marked this pull request as ready for review
August 12, 2026 18:47
bartelink
added a commit
to bartelink/fsharp
that referenced
this pull request
Aug 12, 2026
This was referenced Aug 12, 2026
bartelink
added a commit
to bartelink/fsharp
that referenced
this pull request
Aug 12, 2026
Trim the SolveFunTypeEqn comment to the why + bug link + MatchingOnly invariant, drop the depth-2 memoization control block (depth-3 is the minimal reproducing case), and count invocations with a mutable int instead of a ResizeArray of unused labels. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4cfb1c86-0d7e-45e6-9529-3c5f301c0912
Locks that the domain-order fix in SolveFunTypeEqn keeps recursive inline SRTP memoization nullness-neutral under --checknulls+: a nullable argument annotation still flows through the recursive specialization and produces the same precise FS3261 deref warning (no lost/spurious warning, no internal error). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4cfb1c86-0d7e-45e6-9529-3c5f301c0912
…tp-regression # Conflicts: # azure-pipelines-PR.yml
…tp-regression # Conflicts: # src/Compiler/Checking/ConstraintSolver.fs # tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs
abonie
approved these changes
Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The recursive inline SRTP resolution fix (FSharpPlus
memoizeN) landed in #19785. This adds the one piece that PR didn't carry: a--checknulls+regression test locking that the domain-order fix stays nullness-neutral — a nullable argument annotation still flows through the recursive specialization and produces the same preciseFS3261dereference warning, with no lost or spurious warning and no internal error.