-
Notifications
You must be signed in to change notification settings - Fork 809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reenable β-reduction of immediately-invoked F#-defined generic delegates #18401
Merged
T-Gro
merged 3 commits into
dotnet:main
from
brianrourkeboll:generic-delegate-immediate-invoke
Mar 31, 2025
Merged
Reenable β-reduction of immediately-invoked F#-defined generic delegates #18401
T-Gro
merged 3 commits into
dotnet:main
from
brianrourkeboll:generic-delegate-immediate-invoke
Mar 31, 2025
Conversation
This file contains 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
❗ Release notes required
|
9a236b2
to
b9b8cfe
Compare
T-Gro
approved these changes
Mar 26, 2025
KevinRansom
reviewed
Mar 27, 2025
tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpressions.fs
Outdated
Show resolved
Hide resolved
KevinRansom
reviewed
Mar 27, 2025
- Remove the assembly reference to `System.Collections` during normalization since it does not match across target frameworks.
auto-merge was automatically disabled
March 27, 2025 01:30
Head branch was pushed to by a user without write access
b9b8cfe
to
92cdc41
Compare
T-Gro
approved these changes
Mar 27, 2025
edgarfgp
approved these changes
Mar 31, 2025
psfinaki
approved these changes
Mar 31, 2025
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.
Description
Reenable β-reduction and subsequent reoptimization of immediately-invoked F#-defined generic delegates.
This optimization was added as part of https://github.com/fsharp/fslang-design/blob/main/tooling/FST-1034-lambda-optimizations.md in [RFC FS-1087, FS-1097, FS-1098] tasks, resumable state machines, inline on parameters #6811. It originally applied to both generic and non-generic delegates.
I made use of this optimization when writing https://github.com/fsprojects/FSharp.Collections.Builders — but it turns out that the optimization has no longer been applied to code like that since .NET 7.
Fix immediate delegate invoke #12920 (1b39cde) effectively restricted the optimization to non-generic delegates here:
I.e., before,
(|DelegateInvokeExpr|_|)
would match delegates with type arguments; after, it would not.It does not seem like that change was essential to the fix for Expected type error on delegate #5607. I added the tests from Fix immediate delegate invoke #12920 as emitted IL tests here, and they:
Checklist