Extend async override virtual call coverage#128313
Open
Copilot wants to merge 1 commit into
Open
Conversation
Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/f0cdee65-d4c1-4916-bbd3-9dcb4dcfe398 Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
MichalStrehovsky
May 18, 2026 07:03
View session
Member
|
/azp run runtime-nativeaot-outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
|
Tagging subscribers to this area: @agocke |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands the src/tests/async/override/override.cs async-override test coverage by adding an awaited-call wrapper path and introducing a generic virtual async method (M2<T>) with overrides across two class hierarchies.
Changes:
- Add
M2<T>(T first, T second)as a virtual async method on bothBaseandBase1, with overrides in derived types returning lists that reflect dispatch selection. - Add
[NoInlining]async helper wrappers thatawaitvirtual calls (AwaitBaseM1/AwaitBaseM2) to exercise awaited virtual dispatch call sites. - Extend assertions to validate both direct
.Resultcalls and the awaited-wrapper paths for overridden implementations.
Comment on lines
121
to
126
| Base b = new Derived1(); | ||
| Assert.Equal(2, b.M1().Result); | ||
| Assert.Equal(2, AwaitBaseM1(b).Result); | ||
| Assert.Equal(new List<int> { 2 }, b.M2(2, 3).Result); | ||
| Assert.Equal(new List<int> { 2 }, AwaitBaseM2(b, 2, 3).Result); | ||
|
|
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.
Adds coverage for awaited virtual dispatch and generic virtual async overrides in
src/tests/async/override/override.cs.Awaited virtual calls
NoInlininghelpers thatawaitBase.M1()andBase1.M1()..Resultvirtual calls and awaited wrapper calls.Generic virtual async overrides
M2<T>(T first, T second)across both override hierarchies.