Implement direct delegates - #19993
Conversation
❗ Release notes requiredYou can open this PR in browser to add release notes: open in github.dev
|
This comment has been minimized.
This comment has been minimized.
|
Ready for another pass, think I addressed everything. (But alternatives and unresolved questions in the RFC need answers still:)) |
I think this is not needed anymore, Tomas has added a msbuild way as well as compiler flag to disable specific language features:
or <ItemGroup>
<DisabledLanguageFeatures Include="DirectDelegateConstruction" />
</ItemGroup>You may want to check it picks up as is to allow selectively disabling the feature. |
| <Compile Include="EmittedIL\CompiledNameAttribute\CompiledNameAttribute.fs" /> | ||
| <Compile Include="EmittedIL\ComputationExpressions\ComputationExpressions.fs" /> | ||
| <Compile Include="EmittedIL\ComputedCollections\ComputedCollections.fs" /> | ||
| <Compile Include="EmittedIL\DirectDelegates\DirectDelegates.fs" /> |
There was a problem hiding this comment.
Since the use cases are known in the RFC and often framework-integrated, it would be great to have some smoke tests for this integration.
(ASP.NET routing/minimal APIs, dependency-injection containers, mocking libraries, serializers, and logging/diagnostics that print the bound method name. With F# they see Invoke on a closure rather than the intended method, which breaks or degrades these scenarios..)
Either going via "Regression tests" suite and referencing a separate repo and building it with the fresh compiler.
Or picking a few cases and doing an .fsx test with #load of a few chosen libraries?
There was a problem hiding this comment.
@kerams Are you planning to address this one? Or otherwise is it ready to merge from your standpoint?
Direct delegate to a static method on a value type boxes the ref-type first arg as the declaring struct → garbage /
|
|
🤖🕵️ Fixed in |
|
🔍 Tooling Safety Check — Affects-Compiler-Output
|
Description
Implements fsharp/fslang-suggestions#1083, fixes #11898. RFC.
Test cases should cover everything mentioned in the language suggestion.
Checklist