Remove dead NativeAOT dynamic-delegate path from System.Delegate#131150
Merged
MichalStrehovsky merged 2 commits intoJul 22, 2026
Conversation
|
Azure Pipelines: 16 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib |
Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Remove dead NativeAOT dynamic-delegate path from System.Delegate
Remove dead NativeAOT dynamic-delegate path from Jul 21, 2026
System.Delegate
jkotas
approved these changes
Jul 21, 2026
MichalStrehovsky
marked this pull request as ready for review
July 22, 2026 01:12
MichalStrehovsky
deleted the
copilot/remove-dead-nativeaot-dynamic-delegate-path
branch
July 22, 2026 01:13
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Member
|
@MichalPetryka the merge conflict you requested is now in |
This was referenced Jul 22, 2026
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.
main PR N/A
Description
Delegate.IsDynamicDelegate()in NativeAOT checked an impossible condition (GetThunk(MulticastThunk) == IntPtr.Zero), leaving an unreachableDynamicInvokeImplbranch. This change removes that dead representation check and keepsDynamicInvokeon the normal reflection-based invoke path.Core runtime cleanup
IsDynamicDelegate().DynamicInvokeImpl.CombineImplguard that depended onIsDynamicDelegate().Behavior-preserving simplification
ReflectionAugments.GetDelegateDynamicInvokeInfo(GetType()).wrapInTargetInvocationException: true).Scope control
Customer Impact
Lower maintenance risk in delegate invocation code by removing unreachable logic and redundant branching in a core runtime type.
Regression
Not a recent regression fix; this is dead-code removal and path simplification.
Testing
Focused validation was run to ensure normal
DynamicInvokebehavior remains intact (including targeted delegateDynamicInvokecoverage) and CoreLib/NativeAOT build viability was rechecked.Risk
Low. Narrowly scoped to deleting unreachable logic and preserving the existing active invocation path.
Package authoring no longer needed in .NET 9
IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.