illink: Fix TypeMap instantiation not propagating to TypeMapAssociation entries#127554
Closed
Copilot wants to merge 2 commits intocopilot/fix-typemap-instantiation-issuefrom
Closed
illink: Fix TypeMap instantiation not propagating to TypeMapAssociation entries#127554Copilot wants to merge 2 commits intocopilot/fix-typemap-instantiation-issuefrom
Copilot wants to merge 2 commits intocopilot/fix-typemap-instantiation-issuefrom
Conversation
…llow-up) Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/cf93865a-0ed7-45ea-afc8-fbca5c23c3e5 Co-authored-by: jtschuster <36744439+jtschuster@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix TypeMap instantiation not propagating to TypeMapAssociation entries
illink: Fix TypeMap instantiation not propagating to TypeMapAssociation entries
Apr 29, 2026
Contributor
|
Tagging subscribers to this area: @agocke, @dotnet/illink |
This was referenced Apr 29, 2026
Open
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.
TypeMapHandler.MarkTypeMapAttributecalledAnnotations.MarkInstantiated(targetTypeDef)directly, bypassingMarkRequirementsForInstantiatedTypes.ProcessInstantiatedwas therefore never invoked from that path, so anyTypeMapAssociationentry keyed on that target as source type stayed unprocessed unless the type was independently instantiated by user code.Description
MarkStep.csMarkRequirementsForInstantiatedTypes:protected virtual→protected internal virtualsoTypeMapHandler(same assembly) can call it.TypeMapHandler.csMarkTypeMapAttribute, route through the full instantiation pipeline:This ensures
ProcessInstantiatedruns, which marks associatedTypeMapAssociationentries.TypeMap.cs(test)TypeMap<UsedTypeMap>whose target differs from its trim target, paired with aTypeMapAssociation<UsedTypeMap>whose source is that target. Only the trim target isnew'd inMain; the target reaches instantiation solely via TypeMap processing. Without the fix, theTypeMapAssociationattribute is silently dropped.By = Tool.TrimmersoILCompiler.Trimming.Testspasses; the equivalent ILCompiler fix is left as a follow-up (per reviewer guidance).Note
This PR description was generated with AI assistance (GitHub Copilot).