Skip to content

Preserve duplicate exported types in managed ILAsm - #137097

Merged
jkoritzinsky merged 5 commits into
dotnet:mainfrom
jkoritzinsky:dev/jkoritzinsky/ilasm-duplicate-forwarders-pr
Nov 7, 2026
Merged

jkoritzinsky merged 5 commits into
dotnet:mainfrom
jkoritzinsky:dev/jkoritzinsky/ilasm-duplicate-forwarders-pr

Conversation

@jkoritzinsky

@jkoritzinsky jkoritzinsky commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Preserve each duplicate top-level ExportedType declaration, implementation, flags, and custom attributes in error-tolerant output. Nested exported-type lookup continues to resolve to the first declaration.
  • Report ILA0065 for duplicate full names and reject normal output, as required by ECMA-335 II.22.14. -ERR / -ERROR preserves the duplicate metadata for malformed-IL consumers.
  • Add regression coverage for different and identical forwarder destinations, multi-destination forwarders, assembly and netmodule metadata, nested declarations, file-backed rows, source locations, and CLI error-tolerant behavior.

Validation

  • build.cmd tools.ilasm -test (from the repository root in PowerShell) — passed; 5,813 tests, 0 failures, 3 skipped.
  • Verified all duplicate-forwarder regression cases fail before the fix and pass with it.
  • git diff --check — passed.

Note

This pull request description was generated with GitHub Copilot.

jkoritzinsky and others added 4 commits November 6, 2026 09:55
Diagnose duplicate top-level ExportedType full names with ILA0065 and preserve their metadata only with explicit error tolerance.

Co-authored-by: Copilot App <[email protected]>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 5 pipeline(s).
10 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @dotnet/jit-contrib
See info in area-owners.md if you want to be subscribed.

@jkotas

jkotas commented Nov 6, 2026

Copy link
Copy Markdown
Member

Similarly, do we allow duplicate type definition names in error tolerant mode?

@jkoritzinsky

Copy link
Copy Markdown
Member Author

ilasm always merges multiple type definitions with the same name into the same type. There's no way to specify duplicate type definition names in the .il language syntax.

@jkoritzinsky

Copy link
Copy Markdown
Member Author

/ba-g cdac failure cause has been reverted

@jkoritzinsky
jkoritzinsky enabled auto-merge (squash) November 7, 2026 19:16
@jkoritzinsky
jkoritzinsky merged commit fa5277b into dotnet:main Nov 7, 2026
63 checks passed
@github-project-automation github-project-automation Bot moved this to Done in AppModel Nov 7, 2026
@jkoritzinsky
jkoritzinsky deleted the dev/jkoritzinsky/ilasm-duplicate-forwarders-pr branch November 8, 2026 01:16
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants