Skip to content

Commit 31f3dde

Browse files
committed
Revert "Remove duplicate doc comment & clean up."
Let the later changes in stdlib/public/Concurrency/Task.swift win, since they contain and supersede this minor fix anyhow, instead of creating a merge conflict with 'main'. This reverts commit 1d63a5d.
1 parent ca8254f commit 31f3dde

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

stdlib/public/Concurrency/Task.swift

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,31 @@ extension Task {
6060
/// If the awaited on task gets cancelled externally the `get()` will throw
6161
/// a cancellation error.
6262
///
63-
/// If the task gets cancelled internally --
64-
/// for example, by checking for cancellation
65-
/// and throwing a specific error, or by calling `checkCancellation()`,
66-
/// then the error thrown by the task is rethrown here.
63+
/// If the task gets cancelled internally, e.g. by checking for cancellation
64+
/// and throwing a specific error or using `checkCancellation` the error
65+
/// thrown out of the task will be re-thrown here.
6766
public var value: Success {
6867
get async throws {
6968
return try await _taskFutureGetThrowing(_task)
7069
}
7170
}
7271

73-
/// Wait for the task to complete, returning its result.
72+
/// Wait for the task to complete, returning (or throwing) its result.
73+
///
74+
/// ### Priority
75+
/// If the task has not completed yet, its priority will be elevated to the
76+
/// priority of the current task. Note that this may not be as effective as
77+
/// creating the task with the "right" priority to in the first place.
78+
///
79+
/// ### Cancellation
80+
/// If the awaited on task gets cancelled externally the `get()` will throw
81+
/// a cancellation error.
82+
///
83+
/// If the task gets cancelled internally, e.g. by checking for cancellation
84+
/// and throwing a specific error or using `checkCancellation` the error
85+
/// thrown out of the task will be re-thrown here.
86+
87+
/// Wait for the task to complete, returning its `Result`.
7488
///
7589
/// ### Priority
7690
/// If the task has not completed yet, its priority will be elevated to the
@@ -81,10 +95,9 @@ extension Task {
8195
/// If the awaited on task gets cancelled externally the `get()` will throw
8296
/// a cancellation error.
8397
///
84-
/// If the task gets cancelled internally --
85-
/// for example, by checking for cancellation
86-
/// and throwing a specific error, or by calling `checkCancellation()`,
87-
/// then the error thrown by the task is returned here.
98+
/// If the task gets cancelled internally, e.g. by checking for cancellation
99+
/// and throwing a specific error or using `checkCancellation` the error
100+
/// thrown out of the task will be re-thrown here.
88101
public var result: Result<Success, Failure> {
89102
get async {
90103
do {

0 commit comments

Comments
 (0)