@@ -37,7 +37,7 @@ extension Task {
37
37
/// it is always able to return the current `Task` in which we are currently
38
38
/// running.
39
39
public static func current( ) async -> Task {
40
- fatalError ( " \( #function) not implemented yet. " )
40
+ fatalError ( " \( #function) not implemented yet. " ) // TODO: needs a built-in function
41
41
}
42
42
}
43
43
@@ -100,13 +100,16 @@ extension Task {
100
100
/// Dropping a handle however means losing the ability to await on the task's result
101
101
/// and losing the ability to cancel it.
102
102
public final class Handle < Success, Failure: Error > {
103
- /// Wait for the task to complete, returning (or throwing) its result.
104
- ///
105
- /// ### Priority
106
- /// If the task has not completed yet, its priority will be elevated to the
107
- /// priority of the current task. Note that this may not be as effective as
108
- /// creating the task with the "right" priority to in the first place.
109
- public func get( ) async throws -> Success {
103
+ /// Wait for the task to complete, returning (or throwing) its result.
104
+ ///
105
+ /// ### Priority
106
+ /// If the task has not completed yet, its priority will be elevated to the
107
+ /// priority of the current task. Note that this may not be as effective as
108
+ /// creating the task with the "right" priority to in the first place.
109
+ ///
110
+ /// ### Cancellation
111
+ /// If the awaited on task gets cancelled the `get()` will throw a cancellation error.
112
+ public func get( ) async throws -> Success {
110
113
fatalError ( " \( #function) not implemented yet. " )
111
114
}
112
115
@@ -124,18 +127,6 @@ extension Task {
124
127
}
125
128
}
126
129
127
- extension Task . Handle where Failure == Never {
128
- /// Wait for the task to complete, returning its result.
129
- ///
130
- /// ### Priority
131
- /// If the task has not completed yet, its priority will be elevated to the
132
- /// priority of the current task. Note that this may not be as effective as
133
- /// creating the task with the "right" priority to in the first place.
134
- public func get( ) async -> Success {
135
- fatalError ( " \( #function) not implemented yet. " )
136
- }
137
- }
138
-
139
130
// ==== Detached Tasks ---------------------------------------------------------
140
131
141
132
extension Task {
0 commit comments