Fix runtime async in multifile compilation#122451
Merged
MichalStrehovsky merged 1 commit intodotnet:mainfrom Dec 11, 2025
Merged
Fix runtime async in multifile compilation#122451MichalStrehovsky merged 1 commit intodotnet:mainfrom
MichalStrehovsky merged 1 commit intodotnet:mainfrom
Conversation
1. When compiling a library, compile all methods including async variants. 2. When enumerating methods on types, generate variants for every task returning method, not just virtuals. The 2 is a bit surprising but it matches what we now do in https://github.com/dotnet/runtime/blob/d31e5990b896447bfc3dbe98cfe6ec3b169a4896/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs#L1849-L1857. We originally restricted this to methods being runtimeasync but changed it in https://github.com/dotnet/runtime/pull/121622/files#diff-132a77bcd3f74cf0e0b04fbccda246c97c91e40562d78cb01fff61cf69403573L1860.
Contributor
|
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes async method handling in multifile compilation by ensuring async variants are generated for all Task-returning methods during library compilation.
Key Changes:
- Modified library compilation to include async variants of methods
- Expanded async variant generation from only virtual/async methods to all Task-returning ECMA methods
- Added proper type checking to ensure only ECMA methods get async variants
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| LibraryRootProvider.cs | Updated to enumerate methods with async variants during library compilation |
| CompilerTypeSystemContext.Async.cs | Broadened async variant generation logic from virtual/async-only to all Task-returning ECMA methods, with updated comments explaining the rationale |
This was referenced Dec 11, 2025
Open
jkotas
approved these changes
Dec 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The 2 is a bit surprising but it matches what we now do in
runtime/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs
Lines 1849 to 1857 in d31e599
Cc @dotnet/ilc-contrib