@@ -331,7 +331,6 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
331331 priority: TaskPriority ? = nil ,
332332 operation: sending @escaping @isolated ( any) ( ) async -> ChildTaskResult
333333 ) {
334- #if compiler(>=5.5) && $BuiltinCreateAsyncTaskInGroup
335334#if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
336335 let flags = taskCreateFlags (
337336 priority: priority, isChildTask: true , copyTaskLocals: false ,
@@ -354,9 +353,6 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
354353 initialSerialExecutor: builtinSerialExecutor,
355354 taskGroup: _group,
356355 operation: operation)
357- #else
358- fatalError ( " Unsupported Swift compiler " )
359- #endif
360356 }
361357
362358 /// Adds a child task to the group, unless the group has been canceled.
@@ -374,7 +370,6 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
374370 priority: TaskPriority ? = nil ,
375371 operation: sending @escaping @isolated ( any) ( ) async -> ChildTaskResult
376372 ) -> Bool {
377- #if compiler(>=5.5) && $BuiltinCreateAsyncTaskInGroup
378373 let canAdd = _taskGroupAddPendingTask ( group: _group, unconditionally: false )
379374
380375 guard canAdd else {
@@ -404,9 +399,6 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
404399 operation: operation)
405400
406401 return true
407- #else
408- fatalError ( " Unsupported Swift compiler " )
409- #endif
410402 }
411403
412404#elseif $Embedded
@@ -416,7 +408,6 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
416408 priority: TaskPriority ? = nil ,
417409 operation: sending @escaping ( ) async -> ChildTaskResult
418410 ) {
419- #if compiler(>=5.5) && $BuiltinCreateAsyncTaskInGroup
420411#if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
421412 let flags = taskCreateFlags (
422413 priority: priority, isChildTask: true , copyTaskLocals: false ,
@@ -434,17 +425,13 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
434425
435426 // Create the task in this group.
436427 _ = Builtin . createAsyncTaskInGroup ( flags, _group, operation)
437- #else
438- fatalError ( " Unsupported Swift compiler " )
439- #endif
440428 }
441429
442430 @_alwaysEmitIntoClient
443431 public mutating func addTaskUnlessCancelled(
444432 priority: TaskPriority ? = nil ,
445433 operation: sending @escaping ( ) async -> ChildTaskResult
446434 ) -> Bool {
447- #if compiler(>=5.5) && $BuiltinCreateAsyncTaskInGroup
448435 let canAdd = _taskGroupAddPendingTask ( group: _group, unconditionally: false )
449436
450437 guard canAdd else {
@@ -469,9 +456,6 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
469456 _ = Builtin . createAsyncTaskInGroup ( flags, _group, operation)
470457
471458 return true
472- #else
473- fatalError ( " Unsupported Swift compiler " )
474- #endif
475459 }
476460
477461#else // if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
@@ -494,7 +478,6 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
494478 public mutating func addTask(
495479 operation: sending @escaping @isolated ( any) ( ) async -> ChildTaskResult
496480 ) {
497- #if compiler(>=5.5) && $BuiltinCreateAsyncTaskInGroup
498481 let flags = taskCreateFlags (
499482 priority: nil , isChildTask: true , copyTaskLocals: false ,
500483 inheritContext: false , enqueueJob: true ,
@@ -508,9 +491,6 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
508491 initialSerialExecutor: builtinSerialExecutor,
509492 taskGroup: _group,
510493 operation: operation)
511- #else
512- fatalError ( " Unsupported Swift compiler " )
513- #endif
514494 }
515495
516496 @available ( SwiftStdlib 5 . 7 , * )
@@ -533,7 +513,6 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
533513 public mutating func addTaskUnlessCancelled(
534514 operation: sending @escaping @isolated ( any) ( ) async -> ChildTaskResult
535515 ) -> Bool {
536- #if compiler(>=5.5) && $BuiltinCreateAsyncTaskInGroup
537516 let canAdd = _taskGroupAddPendingTask ( group: _group, unconditionally: false )
538517
539518 guard canAdd else {
@@ -556,9 +535,6 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
556535 operation: operation)
557536
558537 return true
559- #else
560- fatalError ( " Unsupported Swift compiler " )
561- #endif
562538 }
563539#endif
564540
@@ -860,7 +836,6 @@ public struct ThrowingTaskGroup<ChildTaskResult: Sendable, Failure: Error> {
860836 priority: TaskPriority ? = nil ,
861837 operation: sending @escaping @isolated ( any) ( ) async throws -> ChildTaskResult
862838 ) {
863- #if compiler(>=5.5) && $BuiltinCreateAsyncTaskInGroup
864839 let flags = taskCreateFlags (
865840 priority: priority, isChildTask: true , copyTaskLocals: false ,
866841 inheritContext: false , enqueueJob: true ,
@@ -875,9 +850,6 @@ public struct ThrowingTaskGroup<ChildTaskResult: Sendable, Failure: Error> {
875850 initialSerialExecutor: builtinSerialExecutor,
876851 taskGroup: _group,
877852 operation: operation)
878- #else
879- fatalError ( " Unsupported Swift compiler " )
880- #endif
881853 }
882854
883855 /// Adds a child task to the group, unless the group has been canceled.
@@ -898,7 +870,6 @@ public struct ThrowingTaskGroup<ChildTaskResult: Sendable, Failure: Error> {
898870 priority: TaskPriority ? = nil ,
899871 operation: sending @escaping @isolated ( any) ( ) async throws -> ChildTaskResult
900872 ) -> Bool {
901- #if compiler(>=5.5) && $BuiltinCreateAsyncTaskInGroup
902873 let canAdd = _taskGroupAddPendingTask ( group: _group, unconditionally: false )
903874
904875 guard canAdd else {
@@ -921,9 +892,6 @@ public struct ThrowingTaskGroup<ChildTaskResult: Sendable, Failure: Error> {
921892 operation: operation)
922893
923894 return true
924- #else
925- fatalError ( " Unsupported Swift compiler " )
926- #endif
927895 }
928896#else
929897 @available ( SwiftStdlib 5 . 7 , * )
@@ -946,7 +914,6 @@ public struct ThrowingTaskGroup<ChildTaskResult: Sendable, Failure: Error> {
946914 public mutating func addTask(
947915 operation: sending @escaping ( ) async throws -> ChildTaskResult
948916 ) {
949- #if compiler(>=5.5) && $BuiltinCreateAsyncTaskInGroup
950917 let flags = taskCreateFlags (
951918 priority: nil , isChildTask: true , copyTaskLocals: false ,
952919 inheritContext: false , enqueueJob: true ,
@@ -955,9 +922,6 @@ public struct ThrowingTaskGroup<ChildTaskResult: Sendable, Failure: Error> {
955922
956923 // Create the task in this group.
957924 _ = Builtin . createAsyncTaskInGroup ( flags, _group, operation)
958- #else
959- fatalError ( " Unsupported Swift compiler " )
960- #endif
961925 }
962926
963927 @available ( SwiftStdlib 5 . 7 , * )
@@ -982,7 +946,6 @@ public struct ThrowingTaskGroup<ChildTaskResult: Sendable, Failure: Error> {
982946 public mutating func addTaskUnlessCancelled(
983947 operation: sending @escaping ( ) async throws -> ChildTaskResult
984948 ) -> Bool {
985- #if compiler(>=5.5) && $BuiltinCreateAsyncTaskInGroup
986949 let canAdd = _taskGroupAddPendingTask ( group: _group, unconditionally: false )
987950
988951 guard canAdd else {
@@ -1000,9 +963,6 @@ public struct ThrowingTaskGroup<ChildTaskResult: Sendable, Failure: Error> {
1000963 _ = Builtin . createAsyncTaskInGroup ( flags, _group, operation)
1001964
1002965 return true
1003- #else
1004- fatalError ( " Unsupported Swift compiler " )
1005- #endif
1006966 }
1007967#endif
1008968
0 commit comments