Fix Task.WhenAny documentation typo: change "result value is true" to "This is true" #11477
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.
This PR fixes a documentation typo in the
Task.WhenAny
method remarks that was causing confusion about the return value.Problem
The documentation incorrectly stated:
This wording is misleading because the result value is not literally
true
- it's the first task to complete. The sentence was trying to convey that the behavior described (setting Result to the first task) is true regardless of the task's completion state.Solution
Changed the wording to:
This clarifies that the statement refers to the behavior being true, not the result value being the boolean
true
.Changes Made
WhenAny(Task task1, Task task2)
methodWhenAny<TResult>(Task<TResult> task1, Task<TResult> task2)
method/xml/System.Threading.Tasks/Task.xml
The fix makes the documentation consistent with other
WhenAny
overloads that already use the correct wording.Fixes #11350.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.