@@ -87,175 +87,6 @@ extension Task where Success == Never, Failure == Never {
87
87
}
88
88
}
89
89
90
- @available ( SwiftStdlib 5 . 1 , * )
91
- extension Task where Failure == Error {
92
- #if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
93
- @discardableResult
94
- @_alwaysEmitIntoClient
95
- @available ( * , unavailable, message: " Unavailable in task-to-thread concurrency model " )
96
- public static func runDetached(
97
- priority: TaskPriority ? = nil ,
98
- operation: __owned @Sendable @escaping ( ) async throws -> Success
99
- ) -> Task < Success , Failure > {
100
- fatalError ( " Unavailable in task-to-thread concurrency model " )
101
- }
102
- #else
103
- @discardableResult
104
- @_alwaysEmitIntoClient
105
- @available ( * , deprecated, message: " `Task.runDetached` was replaced by `Task.detached` and will be removed shortly. " )
106
- public static func runDetached(
107
- priority: TaskPriority ? = nil ,
108
- operation: __owned @Sendable @escaping ( ) async throws -> Success
109
- ) -> Task < Success , Failure > {
110
- detached ( priority: priority, operation: operation)
111
- }
112
- #endif
113
- }
114
-
115
- #if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
116
- @discardableResult
117
- @available ( SwiftStdlib 5 . 1 , * )
118
- @available ( * , unavailable, message: " Unavailable in task-to-thread concurrency model " )
119
- @_alwaysEmitIntoClient
120
- public func detach< T> (
121
- priority: TaskPriority ? = nil ,
122
- operation: __owned @Sendable @escaping ( ) async -> T
123
- ) -> Task < T , Never > {
124
- fatalError ( " Unavailable in task-to-thread concurrency model " )
125
- }
126
- #else
127
- @discardableResult
128
- @available ( SwiftStdlib 5 . 1 , * )
129
- @available ( * , deprecated, message: " `detach` was replaced by `Task.detached` and will be removed shortly. " )
130
- @_alwaysEmitIntoClient
131
- public func detach< T> (
132
- priority: TaskPriority ? = nil ,
133
- operation: __owned @Sendable @escaping ( ) async -> T
134
- ) -> Task < T , Never > {
135
- Task . detached ( priority: priority, operation: operation)
136
- }
137
- #endif
138
-
139
- #if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
140
- @discardableResult
141
- @available ( SwiftStdlib 5 . 1 , * )
142
- @available ( * , unavailable, message: " Unavailable in task-to-thread concurrency model " )
143
- @_alwaysEmitIntoClient
144
- public func detach< T> (
145
- priority: TaskPriority ? = nil ,
146
- operation: __owned @Sendable @escaping ( ) async throws -> T
147
- ) -> Task < T , Error > {
148
- fatalError ( " Unavailable in task-to-thread concurrency model " )
149
- }
150
- #else
151
- @discardableResult
152
- @available ( SwiftStdlib 5 . 1 , * )
153
- @available ( * , deprecated, message: " `detach` was replaced by `Task.detached` and will be removed shortly. " )
154
- @_alwaysEmitIntoClient
155
- public func detach< T> (
156
- priority: TaskPriority ? = nil ,
157
- operation: __owned @Sendable @escaping ( ) async throws -> T
158
- ) -> Task < T , Error > {
159
- Task . detached ( priority: priority, operation: operation)
160
- }
161
- #endif
162
-
163
- #if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
164
- @discardableResult
165
- @available ( SwiftStdlib 5 . 1 , * )
166
- @available ( * , unavailable, message: " Unavailable in task-to-thread concurrency model " )
167
- @_alwaysEmitIntoClient
168
- public func asyncDetached< T> (
169
- priority: TaskPriority ? = nil ,
170
- @_implicitSelfCapture operation: __owned @Sendable @escaping ( ) async -> T
171
- ) -> Task < T , Never > {
172
- fatalError ( " Unavailable in task-to-thread concurrency model " )
173
- }
174
- #else
175
- @discardableResult
176
- @available ( SwiftStdlib 5 . 1 , * )
177
- @available ( * , deprecated, message: " `asyncDetached` was replaced by `Task.detached` and will be removed shortly. " )
178
- @_alwaysEmitIntoClient
179
- public func asyncDetached< T> (
180
- priority: TaskPriority ? = nil ,
181
- @_implicitSelfCapture operation: __owned @Sendable @escaping ( ) async -> T
182
- ) -> Task < T , Never > {
183
- return Task . detached ( priority: priority, operation: operation)
184
- }
185
- #endif
186
-
187
- #if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
188
- @discardableResult
189
- @available ( SwiftStdlib 5 . 1 , * )
190
- @available ( * , unavailable, message: " Unavailable in task-to-thread concurrency model " )
191
- @_alwaysEmitIntoClient
192
- public func asyncDetached< T> (
193
- priority: TaskPriority ? = nil ,
194
- @_implicitSelfCapture operation: __owned @Sendable @escaping ( ) async throws -> T
195
- ) -> Task < T , Error > {
196
- fatalError ( " Unavailable in task-to-thread concurrency model " )
197
- }
198
- #else
199
- @discardableResult
200
- @available ( SwiftStdlib 5 . 1 , * )
201
- @available ( * , deprecated, message: " `asyncDetached` was replaced by `Task.detached` and will be removed shortly. " )
202
- @_alwaysEmitIntoClient
203
- public func asyncDetached< T> (
204
- priority: TaskPriority ? = nil ,
205
- @_implicitSelfCapture operation: __owned @Sendable @escaping ( ) async throws -> T
206
- ) -> Task < T , Error > {
207
- return Task . detached ( priority: priority, operation: operation)
208
- }
209
- #endif
210
-
211
- #if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
212
- @available ( SwiftStdlib 5 . 1 , * )
213
- @available ( * , unavailable, message: " Unavailable in task-to-thread concurrency model " )
214
- @discardableResult
215
- @_alwaysEmitIntoClient
216
- public func async < T> (
217
- priority: TaskPriority ? = nil ,
218
- @_inheritActorContext @_implicitSelfCapture operation: __owned @Sendable @escaping ( ) async -> T
219
- ) -> Task < T , Never > {
220
- fatalError ( " Unavailable in task-to-thread concurrency model " )
221
- }
222
- #else
223
- @available ( SwiftStdlib 5 . 1 , * )
224
- @available ( * , deprecated, message: " `async` was replaced by `Task.init` and will be removed shortly. " )
225
- @discardableResult
226
- @_alwaysEmitIntoClient
227
- public func async < T> (
228
- priority: TaskPriority ? = nil ,
229
- @_inheritActorContext @_implicitSelfCapture operation: __owned @Sendable @escaping ( ) async -> T
230
- ) -> Task < T , Never > {
231
- . init( priority: priority, operation: operation)
232
- }
233
- #endif
234
-
235
- #if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
236
- @available ( SwiftStdlib 5 . 1 , * )
237
- @available ( * , unavailable, message: " Unavailable in task-to-thread concurrency model " )
238
- @discardableResult
239
- @_alwaysEmitIntoClient
240
- public func async < T> (
241
- priority: TaskPriority ? = nil ,
242
- @_inheritActorContext @_implicitSelfCapture operation: __owned @Sendable @escaping ( ) async throws -> T
243
- ) -> Task < T , Error > {
244
- fatalError ( " Unavailable in task-to-thread concurrency model " )
245
- }
246
- #else
247
- @available ( SwiftStdlib 5 . 1 , * )
248
- @available ( * , deprecated, message: " `async` was replaced by `Task.init` and will be removed shortly. " )
249
- @discardableResult
250
- @_alwaysEmitIntoClient
251
- public func async < T> (
252
- priority: TaskPriority ? = nil ,
253
- @_inheritActorContext @_implicitSelfCapture operation: __owned @Sendable @escaping ( ) async throws -> T
254
- ) -> Task < T , Error > {
255
- . init( priority: priority, operation: operation)
256
- }
257
- #endif
258
-
259
90
@available ( SwiftStdlib 5 . 1 , * )
260
91
extension Task where Success == Never , Failure == Never {
261
92
@available ( * , deprecated, message: " `Task.Group` was replaced by `ThrowingTaskGroup` and `TaskGroup` and will be removed shortly. " )
0 commit comments