Skip to content
Merged
Show file tree
Hide file tree
Changes from 140 commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
14cdb2b
Add DSL for overload resolution tiebreaker rules
T-Gro Jan 18, 2026
eed6225
Implement compareTypeConcreteness function for RFC tiebreakers
T-Gro Jan 18, 2026
bff8e96
Integrate 'more concrete' tiebreaker into better() function
T-Gro Jan 18, 2026
3b3ffef
Add test infrastructure for Tiebreakers conformance tests
T-Gro Jan 18, 2026
e1e2385
Add RFC example tests 1-4 for Most Concrete tiebreaker
T-Gro Jan 18, 2026
73e1ff1
Add multiple type parameter tests (Examples 5-6)
T-Gro Jan 18, 2026
7e4a950
Add real-world scenario tests for Examples 7-9
T-Gro Jan 18, 2026
627020d
Add tests for Examples 10-12: Optional and ParamArray interactions
T-Gro Jan 18, 2026
1b17909
Add extension method tests for RFC FS-XXXX tiebreaker
T-Gro Jan 18, 2026
706b211
Add byref and Span tests for RFC tiebreaker
T-Gro Jan 18, 2026
0f3bf2a
Add constraint and TDC interaction tests
T-Gro Jan 18, 2026
75e3e2b
Add orthogonal test scenarios for tiebreaker feature
T-Gro Jan 18, 2026
1a9c786
Fix overload resolution concreteness tiebreaker to compare formal par…
T-Gro Jan 19, 2026
3924c11
Sprint 2: Verify test expectations - all RFC examples correctly confi…
T-Gro Jan 19, 2026
65ca1e6
Add optional diagnostics FS3575/FS3576 for concreteness tiebreaker
T-Gro Jan 19, 2026
b56c847
Add LanguageFeature.MoreConcreteTiebreaker language feature flag
T-Gro Jan 19, 2026
21ed52d
Update CONTEXT.md and VISION.md for Sprint 4 completion
T-Gro Jan 19, 2026
bc1bde6
Add release notes and format OverloadResolutionRules for Most Concret…
T-Gro Jan 19, 2026
7ac7cc3
docs: Add RFC example coverage mapping to VISION.md
T-Gro Jan 20, 2026
00914c2
Document deferred items for RFC MoreConcrete tiebreaker
T-Gro Jan 20, 2026
4c9ecab
Cleanup PR: Remove workflow artifacts, add design documentation
T-Gro Jan 20, 2026
e65d861
Add compareTypeConcreteness and aggregateComparisons to OverloadResol…
T-Gro Jan 20, 2026
df5c009
Refactor better() and wasConcretenessTiebreaker() to use rule engine
T-Gro Jan 20, 2026
bb24c00
Add explainIncomparableConcreteness API for enhanced FS0041 diagnostics
T-Gro Jan 21, 2026
6ad81e7
Integrate enhanced FS0041 error message for incomparable concreteness
T-Gro Jan 21, 2026
b629c8c
Sprint 2: Verify error info extension complete (already done in Sprin…
T-Gro Jan 21, 2026
bd52440
Sprint 3: Verify enhanced FS0041 message formatting
T-Gro Jan 21, 2026
53ed498
Sprint 4: Verify enhanced FS0041 diagnostic test
T-Gro Jan 21, 2026
37db094
Better explanations
T-Gro Jan 21, 2026
6954e89
Implement constraint count comparison for type variables (RFC Example…
T-Gro Jan 21, 2026
ed35225
Update documentation: Example 15 now implemented
T-Gro Jan 21, 2026
31c511c
Implement FS3576 diagnostic for bypassed generic overloads
T-Gro Jan 21, 2026
96bfbb4
Fix constraint-based overload tests to expect FS0438
T-Gro Jan 21, 2026
42b17ad
Update release note placeholders with clear TBD markers
T-Gro Jan 21, 2026
3e95280
Fix SRTP regression in MoreConcrete tiebreaker rule
T-Gro Jan 21, 2026
a164742
Add RFC quality assessment for FS-XXXX Most Concrete tiebreaker
T-Gro Jan 21, 2026
0fd35ee
Update RFC diagnostic messages to match FSComp.txt exactly
T-Gro Jan 21, 2026
bccd0d9
Verify RFC claims vs implementation
T-Gro Jan 21, 2026
a9c69a0
change rules from strings to ordered and strongly typed enums
T-Gro Jan 22, 2026
ff753d1
doc changes, cleanups
T-Gro Jan 22, 2026
1ec2bab
Add LanguageFeature.OverloadResolutionPriority for F# 10.0
T-Gro Jan 22, 2026
f6d90ee
Add GetOverloadResolutionPriority() method to MethInfo
T-Gro Jan 22, 2026
891e216
Add OverloadResolutionPriorityAttribute tests for RFC FS-XXXX
T-Gro Jan 22, 2026
23139d4
Fix ORP tests to run as baseline tests (not skipped)
T-Gro Jan 22, 2026
9974608
Sprint 1: Add ORP tests with inline C# library
T-Gro Jan 22, 2026
9cb2a22
Sprint 1: Fix ORP tests - remove Skip, document current behavior
T-Gro Jan 22, 2026
07a094c
Sprint 1: Add ORP tests with inline C# library
T-Gro Jan 22, 2026
f02f714
Sprint 2: Implement ORP pre-filter in ConstraintSolver.fs
T-Gro Jan 22, 2026
73da94c
Sprint 2: Add release notes for OverloadResolutionPriority support
T-Gro Jan 22, 2026
497dbb9
Sprint 3: Add 12 ORP edge case tests
T-Gro Jan 22, 2026
652d1e8
Add FS3590 diagnostic for OverloadResolutionPriority
T-Gro Jan 22, 2026
9163e4f
Move MoreConcreteTiebreaker and OverloadResolutionPriority to preview
T-Gro Jan 23, 2026
ccec98e
Add RequiredFeature to TiebreakRule type
T-Gro Jan 23, 2026
9946c65
Add LangVersion Latest Tests for feature gating verification
T-Gro Jan 23, 2026
996b998
Release notes: Document langversion=preview requirement for MoreConcr…
T-Gro Jan 23, 2026
ad34329
cleanup
T-Gro Jan 23, 2026
5777753
code cleanups
T-Gro Jan 23, 2026
f3118b6
Add RFC documents for tiebreaker and OverloadResolutionPriority features
T-Gro Feb 11, 2026
3c724a3
Remove ORP RFC (already exists in fslang-design)
T-Gro Feb 11, 2026
f50b118
Merge branch 'main' into feature/tiebreakers
T-Gro Feb 12, 2026
fa0a8af
Merge branch 'feature/tiebreakers' of https://github.com/dotnet/fshar…
T-Gro Feb 12, 2026
68920e0
fix CI failures
T-Gro Feb 12, 2026
dd7bf92
filterByOverloadResolutionPriority refactor
T-Gro Feb 12, 2026
ed6f351
Fix Desktop test failures: guard net472-incompatible tiebreaker tests…
T-Gro Feb 12, 2026
4c1662d
Fixup #1: Address CODE-QUALITY, PERF, and TEST-CODE-QUALITY verifier …
T-Gro Feb 12, 2026
d8172a9
Fixup #1 (iteration 2): Address remaining CODE-QUALITY, PERF, TEST-CO…
T-Gro Feb 12, 2026
8165d0c
Remove dead code and reduce API surface in OverloadResolutionRules
T-Gro Feb 12, 2026
6bafd8b
Fixup #2: Remove dead FS3590 diagnostic, hide TiebreakRule from API s…
T-Gro Feb 12, 2026
f7e5d15
Fixup #2 (iteration 2): Remove leftover docs, deduplicate tests, para…
T-Gro Feb 12, 2026
41f8807
Fixup #2 (iteration 3): Remove redundant comments, merge duplicate Wa…
T-Gro Feb 12, 2026
25c370b
Fixup #3: Address PERF, TEST-CODE-QUALITY, and NO-LEFTOVERS verifier …
T-Gro Feb 12, 2026
5346f77
Fixup #3 (iteration 2): Cache GetParamDatas and SRTP checks in moreCo…
T-Gro Feb 12, 2026
14b9c3f
Fix release notes: add PR #19277 links and FSharp.Compiler.Service en…
T-Gro Feb 12, 2026
2d4e2f4
Fixup #1: Address PERF, TEST-COVERAGE, HONEST-ASSESSMENT, NO-LEFTOVER…
T-Gro Feb 12, 2026
c3b0e1d
Fixup #2: Commit 4 test upgrades from typecheck to compileAndRun with…
T-Gro Feb 13, 2026
10addb1
Fixup #3: Fix unnamedArgsRule to use flat comparison list for cross-g…
T-Gro Feb 13, 2026
9277273
Fixup #1: Code quality and perf improvements for overload resolution
T-Gro Feb 13, 2026
bac3b04
Fixup #2: Add MoreConcrete, function-type, and tuple-type test coverage
T-Gro Feb 13, 2026
c3967f0
Fixup #2: Deduplicate tests, absorb standalone Fact tests into moreCo…
T-Gro Feb 13, 2026
0a5cc6d
Fixup #1: Perf optimizations and test coverage improvements
T-Gro Feb 13, 2026
fcc6460
Fix PERF and TEST-CODE-QUALITY verifier issues
T-Gro Feb 13, 2026
42754d9
Fix fantomas formatting in OverloadResolutionRules.fs
T-Gro Feb 13, 2026
ae73afc
draft rfc
T-Gro Feb 13, 2026
f97b018
Remove Description field from TiebreakRule record
T-Gro Feb 13, 2026
00e14df
Wrap paramDataCache, srtpCache, and decidingRuleCache with voption
T-Gro Feb 13, 2026
807acf1
Extract computeConcretenessWarnings helper from GetMostApplicableOver…
T-Gro Feb 13, 2026
dd19c6b
Add Debug.Assert ORPA test verifying two-arg overload selection
T-Gro Feb 13, 2026
49822e1
Add test pinning ORPA behavior on C# indexed properties
T-Gro Feb 13, 2026
c6fd2dc
Report error 3586 when OverloadResolutionPriority is applied to overr…
T-Gro Feb 13, 2026
26db26d
Add Virtual Base ORPA inheritance test
T-Gro Feb 13, 2026
549c03e
Merge main into feature/tiebreakers: resolve conflicts
T-Gro Mar 10, 2026
1c0fd93
Merge remote-tracking branch 'origin/main' into feature/tiebreakers
T-Gro Mar 13, 2026
cfdb985
Add release notes for overload resolution tiebreakers
T-Gro Mar 13, 2026
d776e7f
Merge remote-tracking branch 'origin/main' into feature/tiebreakers
T-Gro Mar 17, 2026
deb773a
Merge origin/main into feature/tiebreakers: resolve attribute caching…
T-Gro Mar 17, 2026
f0b3632
Add WellKnownAttribs O(1) attribute caching and CI test infrastructur…
T-Gro Mar 17, 2026
71435cc
Merge origin/main: resolve conflicts and fix formatting
T-Gro Mar 18, 2026
279c58e
Merge remote-tracking branch 'origin/main' into feature/tiebreakers
T-Gro Mar 23, 2026
125e076
Merge remote-tracking branch 'origin/main' into feature/tiebreakers
T-Gro Mar 24, 2026
fbd5a9b
Merge remote-tracking branch 'origin/main' into feature/tiebreakers
T-Gro Apr 10, 2026
affb518
Merge remote-tracking branch 'origin/main' into feature/tiebreakers
T-Gro Apr 14, 2026
9119f69
Merge remote-tracking branch 'origin/main' into feature/tiebreakers
T-Gro May 12, 2026
291d6a0
Merge remote-tracking branch 'origin/main' into feature/tiebreakers
invalid-email-address Jul 9, 2026
d3d13f4
test: add C#-parity ORPA discriminators (red) for H1/H5/H6
T-Gro Jul 24, 2026
76ad88b
test: replace unreachable H6 ambiguity test with observable cross-cla…
T-Gro Jul 24, 2026
cafd30e
fix: scope ORPA priority by declaring type, not extended type (H6)
T-Gro Jul 24, 2026
c2efc87
test: add naked-generic-receiver cross-class ORPA discriminator; inli…
T-Gro Jul 24, 2026
2daed9f
docs: correct H7 discriminator comments to match empirical grouping
T-Gro Jul 24, 2026
609a92c
fix: apply ORPA among applicable members before betterness (H1)
T-Gro Jul 24, 2026
59993b1
refactor: apply Gate 3V findings (List.memq, tighter comment, 3 guard…
T-Gro Jul 24, 2026
9007334
docs: tighten Gate 3V comments (compactness reviewer)
T-Gro Jul 24, 2026
b4ad265
fix: gate ORPA/concreteness diagnostics behind their language feature…
T-Gro Jul 24, 2026
2e78cd4
fix: FS3575/3576 render distinct signatures; localize FS0041 concrete…
T-Gro Jul 24, 2026
529bd18
test: most-concrete tiebreaker for ctors & generic-type members (red)…
T-Gro Jul 24, 2026
efddebf
feat: most-concrete tiebreaker applies to ctors & generic-type member…
T-Gro Jul 24, 2026
bdcedeb
test: edge-case matrix + differential no-regression gate for most-con…
T-Gro Jul 24, 2026
e6f2b67
fix: order most-concrete tiebreak last; Gate 6V reuse/compactness/tes…
T-Gro Jul 24, 2026
9c67c1f
refactor: extract paramsMentionSRTP; de-tag test comments (Gate 6V co…
T-Gro Jul 25, 2026
0bd429e
refactor: SRTP detection via free-typar walker; add SRTP-ambiguous gu…
T-Gro Jul 25, 2026
5177d56
docs+cleanup: reconcile RFC with shipped scope incl. constructors (a)…
T-Gro Jul 25, 2026
c6f2e73
fix: gate net472-incompatible ORPA test + fold rubber-duck review fin…
T-Gro Jul 26, 2026
9e2b820
Merge branch 'main' into feature/tiebreakers
T-Gro Aug 3, 2026
12c7943
Add OverloadResolutionRules + test Compile entries missed in merge st…
T-Gro Aug 3, 2026
90e38ec
Fix inverted candidate attribution in FS0041 concreteness detail
T-Gro Aug 3, 2026
3af953e
Fix conflated FS0041 concreteness positions for multi-parameter overl…
T-Gro Aug 3, 2026
011e7d2
Promote overload-resolution RFCs to publishable FS-1340 / FS-1338
T-Gro Aug 3, 2026
77358b7
Compact overload-resolution RFCs to terse expert register
T-Gro Aug 4, 2026
542b3ed
Revise overload-resolution RFCs for voice and close two spec gaps
T-Gro Aug 4, 2026
0ae999e
Apply voice/compactness/clarity audit findings to both RFCs
T-Gro Aug 4, 2026
73fc1dd
Move RFC docs to fslang-design
T-Gro Aug 4, 2026
33ec5da
Restore accidentally-removed release-notes entries
T-Gro Aug 4, 2026
9ebec35
Adopt WellKnownAttribs cache for OverloadResolutionPriority
T-Gro Aug 4, 2026
bc521f8
test: pin name-based ORPA recognition on a down-level (slot=None) target
T-Gro Aug 4, 2026
e9c8324
refactor: compact overload-resolution rules and tiebreaker tests
T-Gro Aug 5, 2026
9a59773
test: robust down-level ORPA guard via C# and F# polyfills
T-Gro Aug 5, 2026
ae847ad
Merge branch 'main' into feature/tiebreakers
T-Gro Aug 6, 2026
1580d36
test: split tiebreaker tests into Agnostic / With / Without gating su…
T-Gro Aug 6, 2026
9e6e046
test: give the tiebreaker With-tests real oracles (discriminate which…
T-Gro Aug 6, 2026
0116bbb
Merge remote-tracking branch 'origin/main' into feature/tiebreakers
T-Gro Aug 7, 2026
3b662c9
Merge remote-tracking branch 'origin/main' into feature/tiebreakers
T-Gro Aug 10, 2026
b6a3d1a
Cover RecdCtor case in GetOverloadResolutionPriority
T-Gro Aug 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/release-notes/.FSharp.Compiler.Service/11.0.100.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@

### Added

* Added a "most concrete" tiebreaker for overload resolution (`--langversion:preview`). ([RFC FS-1340](https://github.com/fsharp/fslang-design/pull/834), [PR #19277](https://github.com/dotnet/fsharp/pull/19277))
* Added support for `OverloadResolutionPriorityAttribute` in overload resolution (`--langversion:preview`). ([RFC FS-1338](https://github.com/fsharp/fslang-design/pull/828), [PR #19277](https://github.com/dotnet/fsharp/pull/19277))
* Added internal synthesized-name replay infrastructure for compiler-generated names, preserving normal compilation output while enabling future hot reload name stability work.
* Added `FSharpMemberOrFunctionOrValue.IsPropertyAccessor` convenience property that returns true for compiler-generated property accessors (`get_X` / `set_X`). ([Issue #18157](https://github.com/dotnet/fsharp/issues/18157), [PR #19883](https://github.com/dotnet/fsharp/pull/19883))
* Added warning FS3884 when a function or delegate value is used as an interpolated string argument. ([PR #19289](https://github.com/dotnet/fsharp/pull/19289))
Expand Down
2 changes: 2 additions & 0 deletions docs/release-notes/.Language/preview.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
### Added

* Added a "most concrete" tiebreaker for overload resolution: when several overloads of a method, constructor, or generic-type member are equally applicable, the one with more concrete parameter types is preferred instead of reporting an ambiguity. Requires `--langversion:preview`. ([RFC FS-1340](https://github.com/fsharp/fslang-design/pull/834), [PR #19277](https://github.com/dotnet/fsharp/pull/19277))
* Added support for `System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute` (.NET 9): overloads with a higher priority value are preferred during resolution, matching C#. Requires `--langversion:preview`. ([RFC FS-1338](https://github.com/fsharp/fslang-design/pull/828), [PR #19277](https://github.com/dotnet/fsharp/pull/19277))
* Allow constructing a record via its all-fields constructor, e.g. `MyRecord(a, b)`, with positional or named arguments (`RecordConstructorSyntax` preview feature). Accessibility matches `{ ... }` construction. ([Suggestion #722](https://github.com/fsharp/fslang-suggestions/issues/722), [RFC FS-1073](https://github.com/fsharp/fslang-design/blob/main/RFCs/FS-1073-record-constructors.md), [PR #19974](https://github.com/dotnet/fsharp/pull/19974))

### Fixed
Expand Down
1 change: 1 addition & 0 deletions src/Compiler/AbstractIL/il.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1259,6 +1259,7 @@ type WellKnownILAttributes =
| NullableContextAttribute = (1u <<< 23)
| AttributeUsageAttribute = (1u <<< 24)
| NotNullIfNotNullAttribute = (1u <<< 25)
| OverloadResolutionPriorityAttribute = (1u <<< 26)
| NotComputed = (1u <<< 31)

type internal ILAttributesStoredRepr =
Expand Down
1 change: 1 addition & 0 deletions src/Compiler/AbstractIL/il.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,7 @@ type WellKnownILAttributes =
| NullableContextAttribute = (1u <<< 23)
| AttributeUsageAttribute = (1u <<< 24)
| NotNullIfNotNullAttribute = (1u <<< 25)
| OverloadResolutionPriorityAttribute = (1u <<< 26)
| NotComputed = (1u <<< 31)

/// Represents the efficiency-oriented storage of ILAttributes in another item.
Expand Down
304 changes: 119 additions & 185 deletions src/Compiler/Checking/ConstraintSolver.fs

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/Compiler/Checking/ConstraintSolver.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ type OverloadResolutionFailure =
| PossibleCandidates of
methodName: string *
candidates: OverloadInformation list * // methodNames may be different (with operators?), this is refactored from original logic to assemble overload failure message
cx: TraitConstraintInfo option
cx: TraitConstraintInfo option *
incomparableConcreteness: OverloadResolutionRules.IncomparableConcretenessInfo option

/// Represents known information prior to checking an expression or pattern, e.g. it's expected type
type OverallTy =
Expand Down
9 changes: 9 additions & 0 deletions src/Compiler/Checking/Expressions/CheckExpressions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1388,6 +1388,15 @@ let MakeAndPublishVal (cenv: cenv) env (altActualParent, inSig, declKind, valRec
| ParentNone -> errorR(Error(FSComp.SR.tcCompiledNameAttributeMisused(), m))
| _ -> ()

// OverloadResolutionPriority not allowed on override members (only diagnosed when the feature is on)
match memberInfoOpt with
| Some (PrelimMemberInfo(memberInfo, _, _)) when
memberInfo.MemberFlags.IsOverrideOrExplicitImpl
&& g.langVersion.SupportsFeature LanguageFeature.OverloadResolutionPriority ->
if attribsHaveValFlag g WellKnownValAttributes.OverloadResolutionPriorityAttribute attrs then
errorR(Error(FSComp.SR.tcOverloadResolutionPriorityOnOverride(), m))
| _ -> ()

let compiledNameIsOnProp =
match memberInfoOpt with
| Some (PrelimMemberInfo(memberInfo, _, _)) ->
Expand Down
Loading
Loading