Skip to content

Commit d7c9cfd

Browse files
committed
fixing build
1 parent 2d83e07 commit d7c9cfd

File tree

2 files changed

+102
-101
lines changed

2 files changed

+102
-101
lines changed

stdlib/public/Concurrency/SourceCompatibilityShims.swift

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,108 @@ extension Task where Success == Never, Failure == Never {
274274
}
275275
}
276276

277+
278+
@available(SwiftStdlib 5.1, *)
279+
extension TaskGroup {
280+
@available(SwiftStdlib 5.1, *)
281+
@available(*, deprecated, renamed: "addTaskUnlessCancelled(priority:operation:)")
282+
@_alwaysEmitIntoClient
283+
public mutating func add(
284+
priority: TaskPriority? = nil,
285+
operation: __owned @Sendable @escaping () async -> ChildTaskResult
286+
) async -> Bool {
287+
return self.addTaskUnlessCancelled(priority: priority) {
288+
await operation()
289+
}
290+
}
291+
292+
@available(*, deprecated, renamed: "addTask(priority:operation:)")
293+
@_alwaysEmitIntoClient
294+
public mutating func spawn(
295+
priority: TaskPriority? = nil,
296+
operation: __owned @Sendable @escaping () async -> ChildTaskResult
297+
) {
298+
self.addTask(priority: priority, operation: operation)
299+
}
300+
301+
@available(*, deprecated, renamed: "addTaskUnlessCancelled(priority:operation:)")
302+
@_alwaysEmitIntoClient
303+
public mutating func spawnUnlessCancelled(
304+
priority: TaskPriority? = nil,
305+
operation: __owned @Sendable @escaping () async -> ChildTaskResult
306+
) -> Bool {
307+
addTaskUnlessCancelled(priority: priority, operation: operation)
308+
}
309+
310+
@available(*, deprecated, renamed: "addTask(priority:operation:)")
311+
@_alwaysEmitIntoClient
312+
public mutating func async(
313+
priority: TaskPriority? = nil,
314+
operation: __owned @Sendable @escaping () async -> ChildTaskResult
315+
) {
316+
addTask(priority: priority, operation: operation)
317+
}
318+
319+
@available(*, deprecated, renamed: "addTaskUnlessCancelled(priority:operation:)")
320+
@_alwaysEmitIntoClient
321+
public mutating func asyncUnlessCancelled(
322+
priority: TaskPriority? = nil,
323+
operation: __owned @Sendable @escaping () async -> ChildTaskResult
324+
) -> Bool {
325+
addTaskUnlessCancelled(priority: priority, operation: operation)
326+
}
327+
}
328+
329+
@available(SwiftStdlib 5.1, *)
330+
extension ThrowingTaskGroup {
331+
@available(*, deprecated, renamed: "addTask(priority:operation:)")
332+
@_alwaysEmitIntoClient
333+
public mutating func add(
334+
priority: TaskPriority? = nil,
335+
operation: __owned @Sendable @escaping () async throws -> ChildTaskResult
336+
) async -> Bool {
337+
return self.addTaskUnlessCancelled(priority: priority) {
338+
try await operation()
339+
}
340+
}
341+
342+
@available(*, deprecated, renamed: "addTask(priority:operation:)")
343+
@_alwaysEmitIntoClient
344+
public mutating func spawn(
345+
priority: TaskPriority? = nil,
346+
operation: __owned @Sendable @escaping () async throws -> ChildTaskResult
347+
) {
348+
addTask(priority: priority, operation: operation)
349+
}
350+
351+
@available(*, deprecated, renamed: "addTaskUnlessCancelled(priority:operation:)")
352+
@_alwaysEmitIntoClient
353+
public mutating func spawnUnlessCancelled(
354+
priority: TaskPriority? = nil,
355+
operation: __owned @Sendable @escaping () async throws -> ChildTaskResult
356+
) -> Bool {
357+
addTaskUnlessCancelled(priority: priority, operation: operation)
358+
}
359+
360+
@available(*, deprecated, renamed: "addTask(priority:operation:)")
361+
@_alwaysEmitIntoClient
362+
public mutating func async(
363+
priority: TaskPriority? = nil,
364+
operation: __owned @Sendable @escaping () async throws -> ChildTaskResult
365+
) {
366+
addTask(priority: priority, operation: operation)
367+
}
368+
369+
@available(*, deprecated, renamed: "addTaskUnlessCancelled(priority:operation:)")
370+
@_alwaysEmitIntoClient
371+
public mutating func asyncUnlessCancelled(
372+
priority: TaskPriority? = nil,
373+
operation: __owned @Sendable @escaping () async throws -> ChildTaskResult
374+
) -> Bool {
375+
addTaskUnlessCancelled(priority: priority, operation: operation)
376+
}
377+
}
378+
277379
@available(SwiftStdlib 5.1, *)
278380
extension Task {
279381
@available(*, deprecated, message: "get() has been replaced by .value")

stdlib/public/Concurrency/TaskGroup+addTask.swift.gyb

Lines changed: 0 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -308,104 +308,3 @@ extension ${TYPE} {
308308
// but the current build has trouble including the generated gyb sources
309309
// such that they are available to the same module. As we move to the
310310
// new build style we should resolve this. rdar://145171772
311-
312-
@available(SwiftStdlib 5.1, *)
313-
extension TaskGroup {
314-
@available(SwiftStdlib 5.1, *)
315-
@available(*, deprecated, renamed: "addTaskUnlessCancelled(priority:operation:)")
316-
@_alwaysEmitIntoClient
317-
public mutating func add(
318-
priority: TaskPriority? = nil,
319-
operation: __owned @Sendable @escaping () async -> ChildTaskResult
320-
) async -> Bool {
321-
return self.addTaskUnlessCancelled(priority: priority) {
322-
await operation()
323-
}
324-
}
325-
326-
@available(*, deprecated, renamed: "addTask(priority:operation:)")
327-
@_alwaysEmitIntoClient
328-
public mutating func spawn(
329-
priority: TaskPriority? = nil,
330-
operation: __owned @Sendable @escaping () async -> ChildTaskResult
331-
) {
332-
self.addTask(priority: priority, operation: operation)
333-
}
334-
335-
@available(*, deprecated, renamed: "addTaskUnlessCancelled(priority:operation:)")
336-
@_alwaysEmitIntoClient
337-
public mutating func spawnUnlessCancelled(
338-
priority: TaskPriority? = nil,
339-
operation: __owned @Sendable @escaping () async -> ChildTaskResult
340-
) -> Bool {
341-
addTaskUnlessCancelled(priority: priority, operation: operation)
342-
}
343-
344-
@available(*, deprecated, renamed: "addTask(priority:operation:)")
345-
@_alwaysEmitIntoClient
346-
public mutating func async(
347-
priority: TaskPriority? = nil,
348-
operation: __owned @Sendable @escaping () async -> ChildTaskResult
349-
) {
350-
addTask(priority: priority, operation: operation)
351-
}
352-
353-
@available(*, deprecated, renamed: "addTaskUnlessCancelled(priority:operation:)")
354-
@_alwaysEmitIntoClient
355-
public mutating func asyncUnlessCancelled(
356-
priority: TaskPriority? = nil,
357-
operation: __owned @Sendable @escaping () async -> ChildTaskResult
358-
) -> Bool {
359-
addTaskUnlessCancelled(priority: priority, operation: operation)
360-
}
361-
}
362-
363-
@available(SwiftStdlib 5.1, *)
364-
extension ThrowingTaskGroup {
365-
@available(*, deprecated, renamed: "addTask(priority:operation:)")
366-
@_alwaysEmitIntoClient
367-
public mutating func add(
368-
priority: TaskPriority? = nil,
369-
operation: __owned @Sendable @escaping () async throws -> ChildTaskResult
370-
) async -> Bool {
371-
return self.addTaskUnlessCancelled(priority: priority) {
372-
try await operation()
373-
}
374-
}
375-
376-
@available(*, deprecated, renamed: "addTask(priority:operation:)")
377-
@_alwaysEmitIntoClient
378-
public mutating func spawn(
379-
priority: TaskPriority? = nil,
380-
operation: __owned @Sendable @escaping () async throws -> ChildTaskResult
381-
) {
382-
addTask(priority: priority, operation: operation)
383-
}
384-
385-
@available(*, deprecated, renamed: "addTaskUnlessCancelled(priority:operation:)")
386-
@_alwaysEmitIntoClient
387-
public mutating func spawnUnlessCancelled(
388-
priority: TaskPriority? = nil,
389-
operation: __owned @Sendable @escaping () async throws -> ChildTaskResult
390-
) -> Bool {
391-
addTaskUnlessCancelled(priority: priority, operation: operation)
392-
}
393-
394-
@available(*, deprecated, renamed: "addTask(priority:operation:)")
395-
@_alwaysEmitIntoClient
396-
public mutating func async(
397-
priority: TaskPriority? = nil,
398-
operation: __owned @Sendable @escaping () async throws -> ChildTaskResult
399-
) {
400-
addTask(priority: priority, operation: operation)
401-
}
402-
403-
@available(*, deprecated, renamed: "addTaskUnlessCancelled(priority:operation:)")
404-
@_alwaysEmitIntoClient
405-
public mutating func asyncUnlessCancelled(
406-
priority: TaskPriority? = nil,
407-
operation: __owned @Sendable @escaping () async throws -> ChildTaskResult
408-
) -> Bool {
409-
addTaskUnlessCancelled(priority: priority, operation: operation)
410-
}
411-
}

0 commit comments

Comments
 (0)