Skip to content

Remove assert from AddNecessaryAsyncReferences#124393

Merged
jtschuster merged 8 commits intodotnet:mainfrom
jtschuster:getAsyncInfoReferences
Feb 16, 2026
Merged

Remove assert from AddNecessaryAsyncReferences#124393
jtschuster merged 8 commits intodotnet:mainfrom
jtschuster:getAsyncInfoReferences

Conversation

@jtschuster
Copy link
Member

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

jtschuster and others added 8 commits February 3, 2026 14:05
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>
Copy link
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

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.Assert that required AsyncHelpers to already be referenced.
  • Explicitly adds System.Runtime.CompilerServices.AsyncHelpers to requiredTypes so the compiler will create the necessary metadata reference when needed.

@jtschuster jtschuster merged commit f704cce into dotnet:main Feb 16, 2026
110 of 114 checks passed
@github-project-automation github-project-automation bot moved this to Done in AppModel Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Outerloop R2R jobs fail when adding async references

2 participants