Add test for non-async generic methods mismatch in ILC scanner/JIT #127782
Conversation
|
Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib |
There was a problem hiding this comment.
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/usingMicrosoft.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 <175728472+Copilot@users.noreply.github.com>
MichalStrehovsky
left a comment
There was a problem hiding this comment.
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.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.