@@ -331,7 +331,6 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
331
331
priority: TaskPriority ? = nil ,
332
332
operation: sending @escaping @isolated ( any) ( ) async -> ChildTaskResult
333
333
) {
334
- #if compiler(>=5.5) && $BuiltinCreateAsyncTaskInGroup
335
334
#if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
336
335
let flags = taskCreateFlags (
337
336
priority: priority, isChildTask: true , copyTaskLocals: false ,
@@ -354,9 +353,6 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
354
353
initialSerialExecutor: builtinSerialExecutor,
355
354
taskGroup: _group,
356
355
operation: operation)
357
- #else
358
- fatalError ( " Unsupported Swift compiler " )
359
- #endif
360
356
}
361
357
362
358
/// Adds a child task to the group, unless the group has been canceled.
@@ -374,7 +370,6 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
374
370
priority: TaskPriority ? = nil ,
375
371
operation: sending @escaping @isolated ( any) ( ) async -> ChildTaskResult
376
372
) -> Bool {
377
- #if compiler(>=5.5) && $BuiltinCreateAsyncTaskInGroup
378
373
let canAdd = _taskGroupAddPendingTask ( group: _group, unconditionally: false )
379
374
380
375
guard canAdd else {
@@ -404,9 +399,6 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
404
399
operation: operation)
405
400
406
401
return true
407
- #else
408
- fatalError ( " Unsupported Swift compiler " )
409
- #endif
410
402
}
411
403
412
404
#elseif $Embedded
@@ -416,7 +408,6 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
416
408
priority: TaskPriority ? = nil ,
417
409
operation: sending @escaping ( ) async -> ChildTaskResult
418
410
) {
419
- #if compiler(>=5.5) && $BuiltinCreateAsyncTaskInGroup
420
411
#if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
421
412
let flags = taskCreateFlags (
422
413
priority: priority, isChildTask: true , copyTaskLocals: false ,
@@ -434,17 +425,13 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
434
425
435
426
// Create the task in this group.
436
427
_ = Builtin . createAsyncTaskInGroup ( flags, _group, operation)
437
- #else
438
- fatalError ( " Unsupported Swift compiler " )
439
- #endif
440
428
}
441
429
442
430
@_alwaysEmitIntoClient
443
431
public mutating func addTaskUnlessCancelled(
444
432
priority: TaskPriority ? = nil ,
445
433
operation: sending @escaping ( ) async -> ChildTaskResult
446
434
) -> Bool {
447
- #if compiler(>=5.5) && $BuiltinCreateAsyncTaskInGroup
448
435
let canAdd = _taskGroupAddPendingTask ( group: _group, unconditionally: false )
449
436
450
437
guard canAdd else {
@@ -469,9 +456,6 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
469
456
_ = Builtin . createAsyncTaskInGroup ( flags, _group, operation)
470
457
471
458
return true
472
- #else
473
- fatalError ( " Unsupported Swift compiler " )
474
- #endif
475
459
}
476
460
477
461
#else // if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
@@ -494,7 +478,6 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
494
478
public mutating func addTask(
495
479
operation: sending @escaping @isolated ( any) ( ) async -> ChildTaskResult
496
480
) {
497
- #if compiler(>=5.5) && $BuiltinCreateAsyncTaskInGroup
498
481
let flags = taskCreateFlags (
499
482
priority: nil , isChildTask: true , copyTaskLocals: false ,
500
483
inheritContext: false , enqueueJob: true ,
@@ -508,9 +491,6 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
508
491
initialSerialExecutor: builtinSerialExecutor,
509
492
taskGroup: _group,
510
493
operation: operation)
511
- #else
512
- fatalError ( " Unsupported Swift compiler " )
513
- #endif
514
494
}
515
495
516
496
@available ( SwiftStdlib 5 . 7 , * )
@@ -533,7 +513,6 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
533
513
public mutating func addTaskUnlessCancelled(
534
514
operation: sending @escaping @isolated ( any) ( ) async -> ChildTaskResult
535
515
) -> Bool {
536
- #if compiler(>=5.5) && $BuiltinCreateAsyncTaskInGroup
537
516
let canAdd = _taskGroupAddPendingTask ( group: _group, unconditionally: false )
538
517
539
518
guard canAdd else {
@@ -556,9 +535,6 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
556
535
operation: operation)
557
536
558
537
return true
559
- #else
560
- fatalError ( " Unsupported Swift compiler " )
561
- #endif
562
538
}
563
539
#endif
564
540
@@ -860,7 +836,6 @@ public struct ThrowingTaskGroup<ChildTaskResult: Sendable, Failure: Error> {
860
836
priority: TaskPriority ? = nil ,
861
837
operation: sending @escaping @isolated ( any) ( ) async throws -> ChildTaskResult
862
838
) {
863
- #if compiler(>=5.5) && $BuiltinCreateAsyncTaskInGroup
864
839
let flags = taskCreateFlags (
865
840
priority: priority, isChildTask: true , copyTaskLocals: false ,
866
841
inheritContext: false , enqueueJob: true ,
@@ -875,9 +850,6 @@ public struct ThrowingTaskGroup<ChildTaskResult: Sendable, Failure: Error> {
875
850
initialSerialExecutor: builtinSerialExecutor,
876
851
taskGroup: _group,
877
852
operation: operation)
878
- #else
879
- fatalError ( " Unsupported Swift compiler " )
880
- #endif
881
853
}
882
854
883
855
/// Adds a child task to the group, unless the group has been canceled.
@@ -898,7 +870,6 @@ public struct ThrowingTaskGroup<ChildTaskResult: Sendable, Failure: Error> {
898
870
priority: TaskPriority ? = nil ,
899
871
operation: sending @escaping @isolated ( any) ( ) async throws -> ChildTaskResult
900
872
) -> Bool {
901
- #if compiler(>=5.5) && $BuiltinCreateAsyncTaskInGroup
902
873
let canAdd = _taskGroupAddPendingTask ( group: _group, unconditionally: false )
903
874
904
875
guard canAdd else {
@@ -921,9 +892,6 @@ public struct ThrowingTaskGroup<ChildTaskResult: Sendable, Failure: Error> {
921
892
operation: operation)
922
893
923
894
return true
924
- #else
925
- fatalError ( " Unsupported Swift compiler " )
926
- #endif
927
895
}
928
896
#else
929
897
@available ( SwiftStdlib 5 . 7 , * )
@@ -946,7 +914,6 @@ public struct ThrowingTaskGroup<ChildTaskResult: Sendable, Failure: Error> {
946
914
public mutating func addTask(
947
915
operation: sending @escaping ( ) async throws -> ChildTaskResult
948
916
) {
949
- #if compiler(>=5.5) && $BuiltinCreateAsyncTaskInGroup
950
917
let flags = taskCreateFlags (
951
918
priority: nil , isChildTask: true , copyTaskLocals: false ,
952
919
inheritContext: false , enqueueJob: true ,
@@ -955,9 +922,6 @@ public struct ThrowingTaskGroup<ChildTaskResult: Sendable, Failure: Error> {
955
922
956
923
// Create the task in this group.
957
924
_ = Builtin . createAsyncTaskInGroup ( flags, _group, operation)
958
- #else
959
- fatalError ( " Unsupported Swift compiler " )
960
- #endif
961
925
}
962
926
963
927
@available ( SwiftStdlib 5 . 7 , * )
@@ -982,7 +946,6 @@ public struct ThrowingTaskGroup<ChildTaskResult: Sendable, Failure: Error> {
982
946
public mutating func addTaskUnlessCancelled(
983
947
operation: sending @escaping ( ) async throws -> ChildTaskResult
984
948
) -> Bool {
985
- #if compiler(>=5.5) && $BuiltinCreateAsyncTaskInGroup
986
949
let canAdd = _taskGroupAddPendingTask ( group: _group, unconditionally: false )
987
950
988
951
guard canAdd else {
@@ -1000,9 +963,6 @@ public struct ThrowingTaskGroup<ChildTaskResult: Sendable, Failure: Error> {
1000
963
_ = Builtin . createAsyncTaskInGroup ( flags, _group, operation)
1001
964
1002
965
return true
1003
- #else
1004
- fatalError ( " Unsupported Swift compiler " )
1005
- #endif
1006
966
}
1007
967
#endif
1008
968
0 commit comments