You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
↑ Release build and forwarder tests passed; the legacy case detects reverting the CopyUsed-to-Save change. ↓ The test did not isolate the effect of explicit forwarder marking; link-all wasn't run locally.
Diagnosis confidence
9/10
↑ The source issue describes how generic interface documentation IDs fail to resolve in ILLink and ILC.
Evidence fit
8/10
↑ The source issue connects the parsing failure to Preserve on a generic interface implementation. ↓ The reported Realm scenario was not reproduced locally.
Some explicit interface implementations cannot be preserved reliably through their documentation signatures when the interface type is generic. This change emits private helpers with ldtoken references instead, including constraint-matched generic helpers so NativeAOT retains generic method instantiations.
The helpers are rooted with DynamicDependency, explicit properties and events are preserved through their accessors, generated names avoid user members, and declaring assemblies are saved when helpers are added to referenced assemblies.
Adds assembly-preparer and end-to-end coverage for generic methods, overloads, constraints, individual [Preserve], accessors, helper-name collisions, and cross-assembly targets.
Backport notes: tools/dotnet-linker/AppBundleRewriter.cs conflicted in SaveAssembly. This branch still has the code that marks type forwarders before an assembly's action is changed to Save; main removed it in #26777, which isn't backported. This backport keeps that code and applies the source change to its condition (Copy → Copy or CopyUsed) so CopyUsed assemblies that are saved also keep their type forwarders. The forwarder test also covers the legacy linker with and without a rewrite.
…ken helpers. (#27352)
Some explicit interface implementations cannot be preserved reliably through their documentation signatures when the interface type is generic. This change emits private helpers with ldtoken references instead, including constraint-matched generic helpers so NativeAOT retains generic method instantiations.
The helpers are rooted with DynamicDependency, explicit properties and events are preserved through their accessors, generated names avoid user members, and declaring assemblies are saved when helpers are added to referenced assemblies.
Adds assembly-preparer and end-to-end coverage for generic methods, overloads, constraints, individual [Preserve], accessors, helper-name collisions, and cross-assembly targets.
Fixesdotnet/runtime#137350.
🤖 Pull request created by Copilot
---------
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Rolf Bjarne Kvinge <rokvin@microsoft.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The new test bypasses the legacy linker’s backport-specific forwarder-marking branch, leaving rewritten CopyUsed assemblies’ forwarder preservation unverified; add coverage with PrepareAssemblies=false.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
New null-forgiving operators violate the review rules and need explicit null checks and consistent nullability modeling while preserving the auto-property required by the accessor test.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Replace null-forgiving operators with explicit null handling
🤖 💡 Nullable — The new null-forgiving operators conflict with .github/skills/code-review/references/review-rules.md:84. Use explicit null checks for constructed values, reflection results, and paths; for the initially unset generic property, model nullability consistently while retaining the auto-property needed by the accessor-preservation test. The same issue occurs in this file at lines 86, 167, 172–174 and in tests/assembly-preparer/ApplyPreserveAttributeTests.cs:259.
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
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.
Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
14c03ce4af83894725e4de21ea06db79783f107c↓ The test did not isolate the effect of explicit forwarder marking; link-all wasn't run locally.
↓ The reported Realm scenario was not reproduced locally.
Some explicit interface implementations cannot be preserved reliably through their documentation signatures when the interface type is generic. This change emits private helpers with ldtoken references instead, including constraint-matched generic helpers so NativeAOT retains generic method instantiations.
The helpers are rooted with DynamicDependency, explicit properties and events are preserved through their accessors, generated names avoid user members, and declaring assemblies are saved when helpers are added to referenced assemblies.
Adds assembly-preparer and end-to-end coverage for generic methods, overloads, constraints, individual [Preserve], accessors, helper-name collisions, and cross-assembly targets.
Fixes dotnet/runtime#137350.
Backport notes:
tools/dotnet-linker/AppBundleRewriter.csconflicted inSaveAssembly. This branch still has the code that marks type forwarders before an assembly's action is changed to Save; main removed it in #26777, which isn't backported. This backport keeps that code and applies the source change to its condition (Copy→Copy or CopyUsed) so CopyUsed assemblies that are saved also keep their type forwarders. The forwarder test also covers the legacy linker with and without a rewrite.Backport of #27352.
🤖 Pull request created by Copilot