Skip to content

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

Open
eduardo-vp wants to merge 2 commits intodotnet:mainfrom
eduardo-vp:add-test-127179
Open

Add test for non-async generic methods mismatch in ILC scanner/JIT #127782
eduardo-vp wants to merge 2 commits intodotnet:mainfrom
eduardo-vp:add-test-127179

Conversation

@eduardo-vp
Copy link
Copy Markdown
Member

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

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.

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

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>.

Comment thread src/tests/async/awaitingnoasyncgeneric/awaitingnoasyncgeneric.cs
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 5, 2026 02:07
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

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

Comment thread src/tests/async/awaitingnoasyncgeneric/awaitingnoasyncgeneric.cs
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