Remove assert from AddNecessaryAsyncReferences#124393
Merged
jtschuster merged 8 commits intodotnet:mainfrom Feb 16, 2026
Merged
Remove assert from AddNecessaryAsyncReferences#124393jtschuster merged 8 commits intodotnet:mainfrom
jtschuster merged 8 commits intodotnet:mainfrom
Conversation
Implements change dotnet#13 from async methods R2R breakdown. Adds utility method for resolving field tokens in R2R compilation.
…nCodegenCompilation.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…nCodegenCompilation.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…cInfoReferences
…r/runtime into getAsyncInfoReferences
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an incorrect assumption in the ReadyToRun compiler’s async reference handling that caused outerloop interop builds to fail when AsyncHelpers wasn’t already referenced in the compiled module. It removes the failing assert and instead ensures AsyncHelpers is explicitly added to the set of required metadata references when async support is needed.
Changes:
- Removed a
Debug.Assertthat requiredAsyncHelpersto already be referenced. - Explicitly adds
System.Runtime.CompilerServices.AsyncHelperstorequiredTypesso the compiler will create the necessary metadata reference when needed.
This was referenced Feb 13, 2026
jakobbotsch
approved these changes
Feb 14, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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 code assumed there would be reference to AsyncHelpers if there is an async method, but that's not necessarily true, and the assert was causing interop tests to fail in outerloops. Instead, we'll just add it to the list of required types.
Closes #124389