Skip to content

Add test for non-async generic methods mismatch in ILC scanner/JIT - #127782

Merged
MichalStrehovsky merged 7 commits into
dotnet:mainfrom
eduardo-vp:add-test-127179
May 14, 2026
Merged

MichalStrehovsky merged 7 commits into
dotnet:mainfrom
eduardo-vp:add-test-127179

Conversation

@eduardo-vp

@eduardo-vp eduardo-vp commented May 5, 2026 •

Copy link
Copy Markdown
Member

Adding test for #127179.

ILC crashes when trying to compile a runtime async method on a generic type that calls a non-async generic method. The JIT tries to use the async call method whereas the scanner only generated information for the thunk.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new async regression test intended to cover #127179 by exercising a generic async ValueTask<T> method awaiting a non-async generic method, targeting an ILC scanner vs JIT expectation mismatch scenario.

Changes:

  • Introduces a new test project under src/tests/async/awaitingnoasyncgeneric/ using Microsoft.NET.Sdk.IL.
  • Adds a simple xUnit test that runs the pattern for both reference and value generic instantiations.
  • Forces optimization on in the test project to ensure the relevant scanning/codegen path is exercised.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/tests/async/awaitingnoasyncgeneric/awaitingnoasyncgeneric.csproj New test project with optimization + process isolation settings.
src/tests/async/awaitingnoasyncgeneric/awaitingnoasyncgeneric.cs New xUnit test and minimal repro pattern using generic ValueTask<T>.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Copilot AI review requested due to automatic review settings May 5, 2026 02:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

@MichalStrehovsky MichalStrehovsky left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For the actual fix, I think we can start with a PR that gets rid of the guessing in ILScanner (the spot where we try to figure out whether to use the runtime async or non-runtime async entrypoint) - just report both dependencies. Once we have a PR doing that, we can do a measurement with https://github.com/MichalStrehovsky/rt-sz and take it from there.

Copilot AI review requested due to automatic review settings May 13, 2026 01:41

This comment was marked as outdated.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Copilot AI review requested due to automatic review settings May 13, 2026 20:26

This comment was marked as outdated.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Copilot AI review requested due to automatic review settings May 13, 2026 20:41

This comment was marked as outdated.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Copilot AI review requested due to automatic review settings May 13, 2026 20:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

@MichalStrehovsky
MichalStrehovsky merged commit 863e48f into dotnet:main May 14, 2026
86 of 88 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants