Order explicit type args by constraint dependencies before unifying - #20342
Open
T-Gro wants to merge 5 commits into
Open
Order explicit type args by constraint dependencies before unifying#20342T-Gro wants to merge 5 commits into
T-Gro wants to merge 5 commits into
Conversation
Contributor
❗ Release notes requiredYou can open this PR in browser to add release notes: open in github.dev
|
A generic value/method with a subtype constraint that references a later type parameter (Register<'a,'b when 'a :> I<'b>>) failed with FS0001 when the argument implements the interface at several instantiations. The explicit type arguments are now unified in dependency order so a parameter referenced by another's constraint is solved first. Fixes #20103 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8ce30fb9-238f-4bb2-8f31-71e8d173c2ca
T-Gro
force-pushed
the
t-gro-issue-20103-cannot-call-method-with-a-generic-interf-d02fa6
branch
from
August 25, 2026 08:57
a443f4d to
3ff71f4
Compare
T-Gro
marked this pull request as ready for review
August 25, 2026 11:48
T-Gro
enabled auto-merge (squash)
August 25, 2026 11:48
…not-call-method-with-a-generic-interf-d02fa6 # Conflicts: # src/Compiler/Facilities/LanguageFeatures.fs # src/Compiler/Facilities/LanguageFeatures.fsi
…generic-interf-d02fa6
abonie
approved these changes
Sep 11, 2026
added 2 commits
September 11, 2026 17:43
Add equal-arity competing overloads with explicit selection assertions and explicit/inferred type arguments. Verify dependency ordering and rollback through red-green and a failed-candidate undo mutation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 137c3de0-8937-4b62-aff3-13ce91c4cdcb
…not-call-method-with-a-generic-interf-d02fa6
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.
Fixes #20103
A generic value or method whose subtype constraint references a later type parameter (
Register<'a, 'b when 'a :> I<'b>>) failed with FS0001 when the supplied argument implemented the interface at more than one instantiation (I<int>andI<string>): the explicit type arguments were unified left-to-right, so'a := Foore-solved'a :> I<'b>while'bwas still unknown and greedily committed it to the wrong instantiation. Explicit type arguments are now unified in constraint-dependency order, so a parameter referenced by another's constraint is solved first. Behind a language-version 11.0 flag; a genuine dependency cycle degrades to the previous left-to-right order.