Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
156dae0
Add ExtensionConstraintSolutions feature flag and gate FS1215 warning
T-Gro Feb 13, 2026
9571d11
Add ITraitAccessorDomain, ITraitContext interfaces and extend TTrait …
T-Gro Feb 13, 2026
e30af04
Thread ITraitContext through compiler freshening and name resolution …
T-Gro Feb 13, 2026
c3dc196
Fix DoD #4: Pass env.TraitContext instead of traitCtxtNone at all cal…
T-Gro Feb 13, 2026
7ab37f1
Extension methods in SRTP constraint solving (Sprint 04)
T-Gro Feb 13, 2026
85c2aff
Fix extension string test to use compileAndRun and add FS1215 warning…
T-Gro Feb 16, 2026
dffe07f
Fix extension operator codegen by providing fallback trait context du…
T-Gro Feb 16, 2026
01b6003
Add operator resolution edge case tests for SRTP extension constraints
T-Gro Feb 16, 2026
69fffb6
Add IWSAM interaction, scope capture, and accessibility tests
T-Gro Feb 16, 2026
6a3fc90
Add cross-assembly extension operator SRTP resolution tests
T-Gro Feb 16, 2026
2391ff9
Remove duplicate and redundant extension operator SRTP tests
T-Gro Feb 16, 2026
0991625
Code quality: defensive assertions, feature flag hoisting, shared helper
T-Gro Feb 16, 2026
a5f9c1b
Add AllowOverloadOnReturnTypeAttribute for return-type-aware overload…
T-Gro Feb 16, 2026
4a4901c
Fix AllowOverloadOnReturnType: update surface area baseline, remove l…
T-Gro Feb 16, 2026
97fa4e9
Refactor ExtensionMethInfosOfTypeInScope to delegate to SelectExtMeth…
T-Gro Feb 17, 2026
be3a8fd
Refactor: SelectExtMethInfosForType composes SelectIndexedExtMethInfo…
T-Gro Feb 17, 2026
ff5bf98
Disable weak resolution for inline code with ExtensionConstraintSolut…
T-Gro Feb 17, 2026
c3ea3c6
Fix cross-assembly extension operator resolution via SRTP
T-Gro Feb 17, 2026
cb1f066
Enable AllowOverloadOnReturnType tests and add coverage
T-Gro Feb 17, 2026
20c54a4
Add weak resolution compatibility tests for ExtensionConstraintSolutions
T-Gro Feb 17, 2026
c2cc352
Fix weak resolution tests: remove duplicate, fix AllowOverloadOnRetur…
T-Gro Feb 17, 2026
154c9a2
Add instance extension method SRTP tests
T-Gro Feb 17, 2026
8368098
Replace failwith casts with InternalError diagnostics in ITraitContext
T-Gro Feb 17, 2026
604bf07
Add cross-accessibility-domain SRTP constraint propagation tests
T-Gro Feb 17, 2026
b752b29
Restore AtMostOneResult early-exit in ExtensionMethInfosOfTypeInScope
T-Gro Feb 17, 2026
b646bb7
Add release notes and SRTP guide for RFC FS-1043
T-Gro Feb 17, 2026
1ce7b31
Fix documentation inaccuracies flagged by verifiers
T-Gro Feb 17, 2026
e5cf19d
Fix code quality and test quality issues from verifiers
T-Gro Feb 18, 2026
0e8d61e
Remove duplicate test and extract shared string repeat extension defi…
T-Gro Feb 18, 2026
3333d02
Merge branch 'main' into feature-operators-extensions
T-Gro Feb 18, 2026
bfd4023
Fix AllowOverloadOnReturnType docs, add RFC widening/op_Implicit tests
T-Gro Feb 18, 2026
9d87d6c
Add AllowOverloadOnReturnType call-site test, fix TypeHashing bootstrap
T-Gro Feb 18, 2026
96abede
Fix codegen crash for unsolved SRTP constraints on rigid typars
T-Gro Feb 18, 2026
293b14d
Add 9 witness quotation tests for RFC FS-1043 new functionality
T-Gro Feb 18, 2026
23cc7e1
Add breaking change regression tests for RFC FS-1043 top 5 scenarios
T-Gro Feb 19, 2026
02fbd0f
Add RFC FS-1043 proposed changes document with original for diffing
T-Gro Feb 19, 2026
b9f9596
Add unary negate, multiply, delegate compat tests for RFC FS-1043
T-Gro Feb 19, 2026
e816983
Narrow catch-all exception handler in CreateImplFileTraitContext
T-Gro Feb 20, 2026
dc971b9
Add Debug.Assert traces to IlxGen ErrorResult paths
T-Gro Feb 20, 2026
2fe4a47
Add CompilerCompat test for extension operator on external type
T-Gro Feb 20, 2026
fdc857a
Add 4 SRTP extension operator tests
T-Gro Feb 20, 2026
59352ac
Fix SRTP extension tests: use real recursion and extension (+) operators
T-Gro Feb 20, 2026
8041287
Rewrite 'Recursive inline SRTP function' test as negative test for er…
T-Gro Feb 20, 2026
36312b8
Rewrite RFC widening test with actual RFC example
T-Gro Feb 20, 2026
e8bab9a
Fix CompilerCompat suite: move LangVersion to MSBuild args, revert Pr…
T-Gro Feb 20, 2026
e266aa6
Fix AllowOverloadOnReturnType test: assert compile failure until attr…
T-Gro Feb 20, 2026
e9ed221
Fix 3 remaining SRTP reification tests and remove Debug.Assert in cod…
T-Gro Feb 20, 2026
0f29cec
Narrow canonicalization skip for extension SRTP constraints
T-Gro Feb 23, 2026
a58b7d5
Add warning 3882 for unresolved trait calls in IlxGen
T-Gro Feb 23, 2026
0201ad1
Add test asserting warning 3882 is emitted for unresolved SRTP trait …
T-Gro Feb 23, 2026
dc3b588
Eliminate obj from ITraitContext: add generic typed interface
T-Gro Feb 23, 2026
614642a
Audit traitCtxtNone call sites for RFC FS-1043
T-Gro Feb 25, 2026
dda91ac
Document FS1215 gating scope and AllowOverloadOnReturnType design dec…
T-Gro Feb 25, 2026
eb04ca6
Add tests for extension operator SRTP scenarios (TC1, TC2, TC6, TC7, …
T-Gro Feb 25, 2026
b608e03
Fix Sprint 3 TC1 tests to use ^T for SRTP scope testing and reuse str…
T-Gro Feb 25, 2026
61e2767
Add tests for AllowOverloadOnReturnType scenarios (TC5, AO2, AO3, AO4)
T-Gro Feb 25, 2026
a932c49
Add CompilerCompat cross-version widening test (TC10)
T-Gro Feb 25, 2026
29980ac
Documentation cleanup: remove RFC markers, rewrite first-person prose…
T-Gro Feb 25, 2026
1941dd4
Fixup #1: Fix control flow, first-person prose, trailing newline
T-Gro Feb 25, 2026
5c94a60
Fixup #1: Restore deleted release notes, add trailing newline
T-Gro Feb 25, 2026
9854219
Fixup #2: Remove stale release note, add trailing newline, fix FS3882…
T-Gro Feb 26, 2026
c57352d
Fixup #3: Refactor to allValsOfModDef, remove merge artifact orphan f…
T-Gro Feb 26, 2026
775f63f
Fixup #3: Restore deleted files and infrastructure from main
T-Gro Feb 26, 2026
06183c1
Fix Warning 3882 test messages, delete vacuous test, fix emission
T-Gro Feb 26, 2026
86da982
Simplify dead allConcrete branch in ExprRequiresWitness
T-Gro Feb 26, 2026
4536572
Document IL extension member gap in CreateImplFileTraitContext
T-Gro Feb 26, 2026
30f0693
Add UoM and optimizer-path extension SRTP tests
T-Gro Feb 26, 2026
a513705
Merge origin/main into feature-operators-extensions
T-Gro Feb 27, 2026
35e0853
Add OPERATORS_RESOLVE_ISSUES.md: standalone plan for orphan cleanup
T-Gro Feb 27, 2026
4a69207
Restore orphan files to main versions (no RFC changes)
T-Gro Feb 27, 2026
0d39cf6
Add ExtensionConstraintSolutions alongside existing language features
T-Gro Feb 27, 2026
930adb9
Restore Nullness.KnownFromConstructor in TypedTree
T-Gro Feb 27, 2026
18c3a3f
Restore deleted functions in TypedTreeOps
T-Gro Feb 27, 2026
7a93dfa
Integrate RFC FS-1043 changes into ConstraintSolver with cache preserved
T-Gro Feb 27, 2026
3309d0d
Restore nullness/DIM orphans in CheckExpressions and CheckDeclarations
T-Gro Feb 27, 2026
feee5cb
Restore build infrastructure to origin/main versions
T-Gro Feb 27, 2026
a6d8030
Build verification and formatting cleanup
T-Gro Feb 27, 2026
4976bdc
Build verification and formatting cleanup
T-Gro Feb 28, 2026
4550ec6
Restore nullness orphan deletions and add #elif tests
T-Gro Feb 28, 2026
3a07a2c
Fixup #1: Restore files lost during merge with main
T-Gro Feb 28, 2026
6713cdb
Fixup #1: Restore 3 orphan files to main and remove debug printfn
T-Gro Feb 28, 2026
7ce65bd
Update FCS surface area baseline for ConditionalDirectiveTrivia.Elif …
T-Gro Feb 28, 2026
6142e98
Remove internal planning documents from docs/
T-Gro Feb 28, 2026
5675e6a
add remarks to .md files
T-Gro Mar 2, 2026
d9a9fc2
more tests added
T-Gro Mar 2, 2026
4bc5c31
remove useless ilTraitCallNotStaticallyResolved
T-Gro Mar 3, 2026
ce97e1e
Report warnings from ErrorResult branches in IlxGen
T-Gro Mar 5, 2026
17dd068
Fix ScopeCapture test to use extrinsic extension on external type
T-Gro Mar 5, 2026
78bac63
Fix ScopeCapture to demonstrate call-site scope capture with Widget
T-Gro Mar 5, 2026
a1c5804
Fix ScopeCapture to use extrinsic extension in separate module
T-Gro Mar 5, 2026
e710321
Fix ScopeCapture to use extrinsic extension with [<AutoOpen>]
T-Gro Mar 5, 2026
d7fbad5
Add built-in operator priority and accessibility negative tests
T-Gro Mar 5, 2026
5286afc
Strengthen DateTime genericity test to prove weak resolution deferral
T-Gro Mar 5, 2026
89cdd76
Add return-type SRTP resolution test (AllowOverloadOnReturnType H2)
T-Gro Mar 5, 2026
c17036a
Test AllowOverloadOnReturnType through SRTP constraint
T-Gro Mar 5, 2026
8e509ba
Fix AllowOverloadOnReturnType SRTP test to handle both FSharp.Core co…
T-Gro Mar 5, 2026
3081070
Extract shared AllowOverloadOnReturnType attribute detection helper
T-Gro Mar 5, 2026
77c6a4a
Tighten negative test diagnostics with withDiagnostics assertions
T-Gro Mar 5, 2026
65c272f
Fix SRTP guide: workaround text and aspirational examples
T-Gro Mar 5, 2026
621b4e8
Add IWSAM orthogonality, genericity, and FSharpPlus priority tests
T-Gro Mar 5, 2026
b375aa5
Fix test quality and coverage issues from verifiers
T-Gro Mar 6, 2026
d119d60
Remove [<AutoOpen>] from ScopeCapture test and srtp-guide doc
T-Gro Mar 6, 2026
28a8443
Fix C3: ScopeCapture uses genuinely extrinsic extension on BCL type
T-Gro Mar 6, 2026
dd02688
Remove duplicate SRTP scope test from IWSAMsAndSRTPsTests
T-Gro Mar 6, 2026
9aeb570
Fix C3: ScopeCapture test uses cross-module pattern to prove scope ca…
T-Gro Mar 6, 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
Prev Previous commit
Next Next commit
Remove [<AutoOpen>] from ScopeCapture test and srtp-guide doc
The [<AutoOpen>] attribute on the Extensions module made the extrinsic
extension available everywhere, defeating the test's purpose of proving
call-site-only SRTP resolution. Restructured to use a flat layout where
Lib.add is defined before Widget exists, and Widget.(+) is only in scope
at the call site. Updated srtp-guide.md to match.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Loading branch information
T-Gro and Copilot committed Mar 6, 2026
commit d119d609fe8f9b94ad1c9c2483d88a15869d82f2
24 changes: 8 additions & 16 deletions docs/srtp-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,17 @@ When solving an SRTP constraint:
With `--langversion:preview`, extrinsic extension members (defined in a separate module from the type) participate in SRTP constraint resolution when they are in scope:

```fsharp
module TypeDefs =
type Widget = { V: int }

[<AutoOpen>]
module Extensions =
open TypeDefs
type Widget with
static member (+) (a: Widget, b: Widget) = { V = a.V + b.V }

module Lib =
// Lib does not explicitly open Extensions — the [<AutoOpen>] attribute
// makes the extrinsic Widget.(+) available throughout the enclosing scope.
let inline add (x: ^T) (y: ^T) = x + y

module Consumer =
open TypeDefs
open Extensions
open Lib
let r = add { V = 1 } { V = 2 } // resolved using Widget.(+) from Extensions
type Widget = { V: int }

type Widget with
static member (+) (a: Widget, b: Widget) = { V = a.V + b.V }

open Lib
// Widget.(+) is in scope HERE at the call site, not at Lib.add's definition site.
let r = add { V = 1 } { V = 2 } // resolved at call site using Widget.(+)
```

### Known Limitations
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,23 @@
// RFC FS-1043: Extrinsic extension methods in SRTP constraint resolution.
// RFC FS-1043: Extension methods captured at call site, not definition site.
//
// IMPORTANT: Widget and its (+) extension are in SEPARATE modules.
// This is an EXTRINSIC extension — the feature RFC FS-1043 actually enables.
// An intrinsic extension (same module) would work even without the feature flag.
//
// The Extensions module is [<AutoOpen>], so its extrinsic (+) operator is
// available throughout the file without explicit opens. Lib.add does NOT
// explicitly open Extensions — the extension is resolved via auto-open scope.
// Lib.add is defined first — at its definition site, Widget does not exist.
// Widget and its (+) extension are defined after Lib. The call site opens Lib
// and uses add with Widget values, proving that SRTP constraints incorporate
// members available at the call site, not just the definition site.

module ScopeCapture

module TypeDefs =
type Widget = { V: int }

[<AutoOpen>]
module Extensions =
open TypeDefs

type Widget with
static member (+)(a: Widget, b: Widget) = { V = a.V + b.V }

module Lib =
let inline add (x: ^T) (y: ^T) = x + y

module Consumer =
open TypeDefs
open Extensions
open Lib
type Widget = { V: int }

type Widget with
static member (+)(a: Widget, b: Widget) = { V = a.V + b.V }

open Lib

let r = add { V = 1 } { V = 2 }
let r = add { V = 1 } { V = 2 }

if r <> { V = 3 } then
failwith $"Expected {{V=3}}, got {r}"
if r <> { V = 3 } then
failwith $"Expected {{V=3}}, got {r}"