Skip to content

[ios-clr] Fix CustomAttributeDecoderTests when type references point to System.Private.CoreLib#127059

Open
kotlarmilos wants to merge 1 commit intodotnet:mainfrom
kotlarmilos:ios-clr/pr-h-custom-attr-decoder
Open

[ios-clr] Fix CustomAttributeDecoderTests when type references point to System.Private.CoreLib#127059
kotlarmilos wants to merge 1 commit intodotnet:mainfrom
kotlarmilos:ios-clr/pr-h-custom-attr-decoder

Conversation

@kotlarmilos
Copy link
Copy Markdown
Member

@kotlarmilos kotlarmilos commented Apr 17, 2026

Description

Part of splitting #125439 into smaller, self-contained PRs.

After ILLink processing, type references in the test assembly may be redirected from System.Runtime to System.Private.CoreLib. The test hard-codes the expected assembly name and fails to match the decoder output. Resolve the actual assembly-reference name from metadata at test time and compare enum types by FullName (so they match across assembly identities).

…to System.Private.CoreLib

After ILLink processing, type references in the test assembly may be
redirected from System.Runtime to System.Private.CoreLib. The test
hard-codes the expected assembly name and fails to match the decoder
output. Resolve the actual assembly-reference name from metadata at
test time and compare enum types by FullName.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates CustomAttributeDecoderTests to be resilient to ILLink/trimming changes where System.Type type references may be redirected from System.Runtime to System.Private.CoreLib, ensuring the decoder output comparisons remain stable across these assembly-identity differences.

Changes:

  • Resolve the expected System.Type assembly reference directly from the test assembly’s metadata (via PEReader) and use it consistently in assertions/type-provider logic.
  • Compare enum types using FullName (after normalizing nested-type separators) instead of relying on runtime Type.GetType resolution.
  • Improve the thrown ArgumentOutOfRangeException with a descriptive message and remove a now-unneeded ActiveIssue gate.

@kotlarmilos kotlarmilos marked this pull request as draft April 17, 2026 09:39
@kotlarmilos kotlarmilos marked this pull request as ready for review April 17, 2026 10:43
@kotlarmilos kotlarmilos added this to the 11.0.0 milestone Apr 17, 2026
@kotlarmilos kotlarmilos added the os-ios Apple iOS label Apr 17, 2026
@kotlarmilos
Copy link
Copy Markdown
Member Author

/azp run runtime-extra-platforms

@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to 'os-ios': @vitek-karas, @kotlarmilos, @steveisok, @akoeplinger
See info in area-owners.md if you want to be subscribed.

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants