[dotnet-linker] Gate the TypeMap workaround for dotnet/runtime#127504 on .NET 10 and earlier. Fixes #25275#26010
Conversation
….NET 10 and earlier The unconditional (2-arg) TypeMap workaround for skipped "actual" types (NSOrderedSet, NSArray, NSDictionary, etc.) works around a bug in ILLink's TypeMapHandler (dotnet/runtime#127504). The runtime fix is only available in .NET 11+, so gate the workaround to only apply when targeting .NET 10 or earlier. On .NET 11+ the conditional (3-arg) TypeMap entries are used for these types, matching the non-workaround path. Tracking issue: #25275 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
This PR updates the dotnet-linker’s TypeMap workaround for dotnet/runtime#127504 so it only applies when targeting .NET 10 or earlier, allowing .NET 11+ builds to use the intended conditional (3-arg) TypeMap entries once the runtime fix is available.
Changes:
- Gate the unconditional (2-arg)
TypeMapAttributeworkaround behindApp.TargetFramework.Version.Major <= 10. - Avoid computing the
skippedActualTypesset when the workaround is disabled.
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
🚀 [CI Build #e35c2fc] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 199 tests passed 🎉 Tests counts✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
The unconditional (2-arg)
TypeMapAttributeworkaround for skipped "actual" types (NSOrderedSet,NSArray,NSDictionary, etc.) works around a bug in ILLink'sTypeMapHandler(dotnet/runtime#127504): the conditional (3-arg) entries for these types are silently trimmed.The runtime fix is only available in .NET 11+, so this gates the workaround to only apply when targeting .NET 10 or earlier (
App.TargetFramework.Version.Major <= 10), mirroring the existing precedent in the same file. On .NET 11+ the conditional (3-arg)TypeMapentries are used, matching the non-workaround path.Validation of the .NET 11 path (workaround disabled) is done via a separate, non-merged PR targeting the
net11.0branch.Fixes #25275
🤖 Pull request created by Copilot