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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
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
2 participants