Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix Task.WhenAny documentation typo: change "result value is true" to "This is true" #11477

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 1, 2025

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 19, 2025

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:

The result value is true even if the first task to complete ended in the Canceled or Faulted state.

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 is true even if the first task to complete ended in the Canceled or Faulted state.

This clarifies that the statement refers to the behavior being true, not the result value being the boolean true.

Changes Made

  • Fixed documentation in WhenAny(Task task1, Task task2) method
  • Fixed documentation in WhenAny<TResult>(Task<TResult> task1, Task<TResult> task2) method
  • Both changes are in /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.

@Copilot Copilot AI changed the title [WIP] What happens when one of the argument tasks throws an exception is unclear Fix Task.WhenAny documentation typo: change "result value is true" to "This is true" Jun 19, 2025
@Copilot Copilot AI requested a review from jeffhandley June 19, 2025 06:54
Copilot finished work on behalf of jeffhandley June 19, 2025 06:54
@dotnet-policy-service dotnet-policy-service bot added the needs-author-action An issue or pull request that requires more info or actions from the author. label Jun 19, 2025
@dotnet-policy-service dotnet-policy-service bot removed the needs-author-action An issue or pull request that requires more info or actions from the author. label Jun 19, 2025
@Copilot Copilot AI requested a review from jeffhandley June 19, 2025 07:14
Copilot finished work on behalf of jeffhandley June 19, 2025 07:14
@jeffhandley jeffhandley marked this pull request as ready for review June 20, 2025 01:45
@jeffhandley jeffhandley reopened this Jun 20, 2025
@jeffhandley jeffhandley reopened this Jun 20, 2025
@jeffhandley jeffhandley requested a review from a team June 21, 2025 03:17
@BillWagner BillWagner requested a review from gewarren June 23, 2025 14:24
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-threading-tasks

@gewarren gewarren enabled auto-merge (squash) June 30, 2025 13:43
auto-merge was automatically disabled June 30, 2025 13:46

Head branch was pushed to by a user without write access

Copilot finished work on behalf of gewarren June 30, 2025 13:46
@Copilot Copilot AI requested a review from gewarren June 30, 2025 13:46
@gewarren gewarren enabled auto-merge (squash) June 30, 2025 14:05
@gewarren gewarren merged commit 7f1d3c5 into main Jul 1, 2025
5 checks passed
@gewarren gewarren deleted the copilot/fix-11350 branch July 1, 2025 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

What happens when one of the argument tasks throws an exception is unclear
3 participants