ILTrim: Preserve implemented interfaces on constructed types - #133913
Draft
jtschuster wants to merge 1 commit into
Draft
jtschuster wants to merge 1 commit into
jtschuster wants to merge 1 commit into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5f633264-d8a6-4199-a816-4c0da8e63873
|
Azure Pipelines: Successfully started running 4 pipeline(s). 12 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/illink |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Interface tokens may remain unmarked, causing assertion failures or invalid metadata.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This pull request updates ILTrim to preserve interface metadata for constructed types, aligning behavior with ILLink.
Changes:
- Updates interface implementation emission in
TypeDefinitionNode.cs. - Removes 13 obsolete expected failures.
File summaries
| File | Summary |
|---|---|
src/coreclr/tools/ILTrim.Tests/ILTrimExpectedFailures.txt |
Removes interface-related expected failures. |
src/coreclr/tools/ILTrim.Core/DependencyAnalysis/TokenBased/TypeDefinitionNode.cs |
Preserves eligible interface metadata; a critical token-marking issue remains unresolved. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
Comment on lines
+165
to
+168
| if (interfaceType != null && | ||
| (writeContext.Factory.InterfaceUse(interfaceType).Marked || | ||
| (writeContext.Factory.ConstructedType((EcmaType)_module.GetObject(Handle)).Marked && | ||
| writeContext.Factory.TypeDefinition(interfaceType.Module, interfaceType.Handle).Marked))) |
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.
Summary
Fix ILTrim interface implementation emission to match ILLink when an implementing type is constructed and its interface type is marked. This preserves interface metadata and enables the associated interface members to remain reachable.
The fix updates
TypeDefinitionNode.WriteInternaland removes the 13 interface-related entries fromILTrimExpectedFailures.txtthat now pass.Validation
dotnet build src/coreclr/tools/ILTrim.Tests/ILTrim.Tests.csprojgit diff --checkThe broader repository baseline build remains blocked by an unrelated generated-resource mismatch in crossgen2.
Note
This pull request description was generated with GitHub Copilot.