Repository navigation
Fix NativeAOT namespace lookup for nested generic types - #135177
Merged
Merged
Conversation
|
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. |
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
jkotas
reviewed
Oct 4, 2026
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Contributor
|
Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib |
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix null Type.Namespace for nested generic types in NativeAOT
Fix NativeAOT namespace lookup for nested generic types
Oct 4, 2026
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
jkotas
reviewed
Oct 4, 2026
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
jkotas
reviewed
Oct 4, 2026
Contributor
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The approach appears consistent, but changing NativeAOT’s metadata schema and every major consumer has a broad binary-format blast radius requiring maintainer review.
Review effort: Balanced
Findings: None
What changed in this PR
Fixes NativeAOT namespace resolution for nested types by encoding their structural parent and traversing enclosing types during reflection.
Changes:
- Unifies namespace/enclosing-type metadata.
- Updates all NativeFormat consumers.
- Adds nested generic, global namespace, and attribute-lookalike tests.
| File | Description |
|---|---|
TypeInfoTests.cs |
Adds regression coverage. |
NativeFormatReaderGen.cs |
Reads the unified parent handle. |
MetadataTypeHashingAlgorithms.cs |
Hashes types by structural parent. |
SchemaDef.cs |
Defines the new schema invariant. |
NativeMetadataWriter.cs |
Formats unified parent records. |
NativeFormatWriterGen.cs |
Writes the unified parent handle. |
Transform.Type.cs |
Emits namespace or enclosing type. |
MetadataNameExtensions.cs |
Traverses structural parents. |
StackTraceMetadata.cs |
Resolves assembly through parents. |
MethodNameFormatter.cs |
Formats nested type names. |
NativeFormatRuntimeNamedTypeInfo.cs |
Resolves inherited namespaces. |
TypeResolver.NativeFormat.cs |
Uses the renamed parent handle. |
MetadataReaderExtensions.NativeFormat.cs |
Excludes nested attribute lookalikes. |
jkotas
reviewed
Oct 4, 2026
jkotas
reviewed
Oct 4, 2026
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Member
|
/azp run runtime-nativeaot-outerloop |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
This was referenced Oct 4, 2026
MichalStrehovsky
approved these changes
Oct 5, 2026
Member
|
/azp run runtime-nativeaot-outerloop |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Member
|
/azp run runtime-nativeaot-outerloop |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
This was referenced Oct 5, 2026
Member
|
/ba-g known issue #135096 |
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.
NativeAOT returned
nullforType.Namespaceon nested generic types, despite their namespace-qualifiedFullName.Fixes #135106