Skip to content

Managed ilasm: validate duplicate field declarations - #136526

Merged
jkoritzinsky merged 13 commits into
dotnet:mainfrom
jkoritzinsky:dev/jkoritzinsky/ilasm-duplicate-field-validation
Oct 28, 2026
Merged

jkoritzinsky merged 13 commits into
dotnet:mainfrom
jkoritzinsky:dev/jkoritzinsky/ilasm-duplicate-field-validation

Conversation

@jkoritzinsky

@jkoritzinsky jkoritzinsky commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Summary

Addresses the duplicate-fields bullet in #135314 without closing the remaining issue items.

  • Report a located ILA0034 error for duplicate field declarations instead of silently dropping them.
  • Preserve duplicate declarations and their associated metadata only with explicit error-tolerant mode (-ERR or -ERROR).
  • Retain ECMA-335 II.22.15 identity rules: owner + name + encoded signature, excluding compiler-controlled (privatescope) fields. Different signatures and owners remain legal.
  • Cover global, nested, generic and reopened types; multiple input and included files; constants, layout and custom attributes; and command-line rejection/emission. Document the behavior without README changes.

Validation

  • .\dotnet.cmd build src\tools\ilasm\src\ILAssembler -p:NuGetAudit=false — passed, zero warnings/errors.
  • Regression probes against the unfixed assembler reproduced missing diagnostics, successful normal assembly and dropped duplicate metadata in error-tolerant mode.
  • .\.dotnet\dotnet.exe test src\tools\ilasm\tests\ILAssembler.Tests -p:NuGetAudit=false --filter 'FullyQualifiedName~DuplicateField|FullyQualifiedName~DistinctFields|FullyQualifiedName~SameFieldInDifferentOwners' — passed, 24 tests.
  • .\.dotnet\dotnet.exe test src\tools\ilasm\tests\ILAssembler.Tests -p:NuGetAudit=false — passed, 5,460 tests; three existing platform/path skips, zero failures.
  • git diff --check — passed.

Note

This change and PR description were prepared with GitHub Copilot assistance.

Report located errors for duplicate fields and retain their metadata only in explicit error-tolerant mode. Preserve ECMA-335 field identity and compiler-controlled exemptions, with library and CLI regression coverage.

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

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 5 pipeline(s).
11 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 Oct 27, 2026

Copy link
Copy Markdown
Member

Conflicts

jkoritzinsky and others added 2 commits October 27, 2026 11:25
Preserve both duplicate-field diagnostics and tests and main's entry-point diagnostics and syntax-recovery coverage.

Co-authored-by: Copilot App <[email protected]>
Keep the PR current with main; no managed ilasm changes or conflict resolutions were needed.

Co-authored-by: Copilot App <[email protected]>
jkoritzinsky and others added 2 commits October 27, 2026 13:17
Include the latest JIT fixes from main without changes to managed ilasm or its diagnostics.

Co-authored-by: Copilot App <[email protected]>
Recycle the diagnostic ID freed by TLS support, pin its value in the duplicate-field tests, and update the behavior documentation.

Co-authored-by: Copilot App <[email protected]>
@jkoritzinsky
jkoritzinsky requested a review from jkotas October 27, 2026 20:42
@jkoritzinsky
jkoritzinsky enabled auto-merge (squash) October 27, 2026 20:54
jkoritzinsky and others added 8 commits October 27, 2026 14:23
Include the latest proxy lookup fix from main; managed ilasm is unchanged.

Co-authored-by: Copilot App <[email protected]>
Include the socket address-family fix that landed during the preceding refresh; managed ilasm is unchanged.

Co-authored-by: Copilot App <[email protected]>
Include the latest Mono attribute-decoding change from main; managed ilasm is unchanged.

Co-authored-by: Copilot App <[email protected]>
Keep the PR current with main's SVE AES API change; managed ilasm is unchanged.

Co-authored-by: Copilot App <[email protected]>
Include the latest Loader and wasm test updates from main; managed ilasm is unchanged.

Co-authored-by: Copilot App <[email protected]>
Include the latest TLS fix from main; managed ilasm is unchanged.

Co-authored-by: Copilot App <[email protected]>
Include the latest NativeAOT test updates from main; managed ilasm is unchanged.

Co-authored-by: Copilot App <[email protected]>
Include the latest VM cleanup from main; managed ilasm is unchanged.

Co-authored-by: Copilot App <[email protected]>
@jkoritzinsky
jkoritzinsky merged commit 4cda5a1 into dotnet:main Oct 28, 2026
64 checks passed
@github-project-automation github-project-automation Bot moved this to Done in AppModel Oct 28, 2026
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Oct 29, 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