Ensure that lambdas are not cached in runtime async#82559
Merged
Conversation
When we bind for return type inference, we don't yet know if the body of the lambda will be a `Task`/`ValueTask`, so we can't say for certain whether runtime async will be enabled in the lambda. Therefore, when we come back to do real binding, and we do know for certain that the lambda is runtime async capable, we need to rebind with runtime async enabled. Fixes dotnet#82551.
AlekseyTs
reviewed
Feb 27, 2026
AlekseyTs
reviewed
Feb 27, 2026
AlekseyTs
reviewed
Feb 27, 2026
Contributor
|
Done with review pass (commit 1) #Closed |
Member
Author
|
@AlekseyTs @jcouv @dotnet/roslyn-compiler for reviews |
This comment has been minimized.
This comment has been minimized.
AlekseyTs
reviewed
Mar 3, 2026
Contributor
|
Done with review pass (commit 2) #Closed |
Member
Author
|
@AlekseyTs address your feedback. @jcouv for review as well. |
3 tasks
AlekseyTs
reviewed
Mar 3, 2026
| } | ||
|
|
||
| Debug.Assert(ReferenceEquals(method.ContainingAssembly, Assembly)); | ||
| Debug.Assert(method.IsDefinition); |
Contributor
Open
3 tasks
This was referenced Mar 10, 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.
When we bind for return type inference, we don't yet know if the body of the lambda will be a
Task/ValueTask, so we can't say for certain whether runtime async will be enabled in the lambda. Therefore, when we come back to do real binding, and we do know for certain that the lambda is runtime async capable, we need to rebind with runtime async enabled. Fixes #82551.Relates to test plan #75960