@@ -44,7 +44,10 @@ public func withTaskCancellationHandler<T>(
4444
4545@available ( SwiftStdlib 5 . 5 , * )
4646extension Task {
47- /// Returns `true` if the task is cancelled, and should stop executing.
47+ /// A Boolean value that indicates whether the task should stop executing.
48+ ///
49+ /// After the value of this property becomes `true`, it remains `true` indefinitely.
50+ /// There is no way to uncancel a task.
4851 ///
4952 /// - SeeAlso: `checkCancellation()`
5053 public var isCancelled : Bool {
@@ -60,10 +63,10 @@ extension Task {
6063
6164@available ( SwiftStdlib 5 . 5 , * )
6265extension Task where Success == Never , Failure == Never {
63- /// Returns `true` if the task is cancelled, and should stop executing.
66+ /// A Boolean value that indicates whether the task should stop executing.
6467 ///
65- /// If no current `Task` is available, returns `false `, as outside of a task
66- /// context no task cancellation may be observed .
68+ /// After the value of this property becomes `true `, it remains `true` indefinitely.
69+ /// There is no way to uncancel a task .
6770 ///
6871 /// - SeeAlso: `checkCancellation()`
6972 public static var isCancelled : Bool {
@@ -75,7 +78,7 @@ extension Task where Success == Never, Failure == Never {
7578
7679@available ( SwiftStdlib 5 . 5 , * )
7780extension Task where Success == Never , Failure == Never {
78- /// Check if the task is cancelled and throw an `CancellationError` if it was.
81+ /// Throws an error if the task was canceled .
7982 ///
8083 /// The error is always an instance of `Task.CancellationError`.
8184 ///
@@ -87,10 +90,10 @@ extension Task where Success == Never, Failure == Never {
8790 }
8891}
8992
90- /// The default cancellation thrown when a task is cancelled .
93+ /// An error that indicates a task was canceled .
9194///
9295/// This error is also thrown automatically by `Task.checkCancellation()`,
93- /// if the current task has been cancelled .
96+ /// if the current task has been canceled .
9497@available ( SwiftStdlib 5 . 5 , * )
9598public struct CancellationError : Error {
9699 // no extra information, cancellation is intended to be light-weight
0 commit comments