Repository navigation
Reject WinRT metadata types in compiler type validation - #133397
Merged
MichalStrehovsky merged 1 commit intoSep 9, 2026
Merged
Conversation
Match CoreCLR's TypeLoadException rejection of WindowsRuntime types and enable the NativeAOT WinRT regression test. Resolves dotnet/runtimelab#182 Co-authored-by: Copilot <[email protected]> Copilot-Session: 3dea65e4-6bec-47a1-b938-b02f43d8a0bb
|
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. |
Contributor
|
Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib |
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
It changes a shared compiler/type-validation rule with potentially broad impact across AOT/tooling scenarios, and I can’t validate downstream behavior or test outcomes here.
Pull request overview
This PR tightens the NativeAOT/compiler type-loadability validation to reject WinRT metadata types (tdWindowsRuntime) with a TypeLoadException, aligning the toolchain’s type rejection behavior with CoreCLR’s WinRT type-load rejection and un-skipping the corresponding Interop WinRT regression test.
Changes:
- Removed the NativeAOT-specific
[ActiveIssue]skip from the WinRT interop regression test so it runs under NativeAOT. - Added a WinRT metadata type rejection check (
type.IsWindowsRuntime) toEnsureLoadableTypeUncached, throwingTypeLoadExceptionviaThrowHelper.
File summaries
| File | Description |
|---|---|
| src/tests/Interop/WinRT/Program.cs | Re-enables the WinRT regression test under NativeAOT by removing the conditional skip. |
| src/coreclr/tools/Common/Compiler/CompilerTypeSystemContext.Validation.cs | Rejects WinRT metadata types during compiler type validation by throwing TypeLoadException. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
jkotas
approved these changes
Sep 8, 2026
Member
Author
|
/ba-g mono crash was #133442 |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This is a trivial fix and lets us get rid of native AOT special casing (that I'm auditing for right now and might do that in the future too).
Match CoreCLR's TypeLoadException rejection of WindowsRuntime types and enable the NativeAOT WinRT regression test.
Resolves dotnet/runtimelab#182