Skip to content

Allow implementation keywords as managed ilasm identifiers - #136735

Merged
jkoritzinsky merged 1 commit into
dotnet:mainfrom
jkoritzinsky:dev/jkoritzinsky/ilassembler-keyword-identifiers
Oct 31, 2026
Merged

jkoritzinsky merged 1 commit into
dotnet:mainfrom
jkoritzinsky:dev/jkoritzinsky/ilassembler-keyword-identifiers

Conversation

@jkoritzinsky

@jkoritzinsky jkoritzinsky commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Managed ILAssembler already accepts method implementation keywords in its id rule, but dottedNamePart used a narrower token list. Consequently, unquoted method names such as async and runtime were rejected in declarations and calls.

Reuse id for dotted name parts, retaining dotted-name tokens and the existing volatile special case. Regenerate the parser and add a 16-case theory covering every implementation keyword as a method name, parameter name, and call target, checking emitted metadata and IL bytes.

I found this case had regressed at some point when trying to run some of the src/tests/ilasm tests with managed ilasm.

Validation (Windows x64)

  • .\build.cmd tools.ilasm -rc Checked -pack -test with the regression tests but without the fix: failed with all 16 new cases failing (5,716 passed, 16 failed, 3 skipped).
  • .\dotnet.cmd build src\tools\ilasm\src\ILAssembler\gen: passed; regenerated output matches the transferred parser apart from generated trailing whitespace.
  • .\build.cmd tools.ilasm -rc Checked -pack -test with the final fix: passed; 5,732 passed, 0 failed, 3 skipped. Native executable generation and package creation also succeeded. The command reports Debug tools configuration despite the -rc Checked argument.

Note

This pull request was prepared with GitHub Copilot.

Reuse the identifier grammar for dotted name parts and cover all implementation keywords in method declarations, parameters, and calls.

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

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 4 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.

@jkoritzinsky
jkoritzinsky enabled auto-merge (squash) October 30, 2026 21:09
@jkoritzinsky
jkoritzinsky merged commit fba6a1c into dotnet:main Oct 31, 2026
64 checks passed
@github-project-automation github-project-automation Bot moved this to Done in AppModel Oct 31, 2026
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 4, 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