@@ -392,6 +392,7 @@ extension Task {
392
392
/// - Returns: handle to the task, allowing to `await handle.get()` on the
393
393
/// tasks result or `cancel` it. If the operation fails the handle will
394
394
/// throw the error the operation has thrown when awaited on.
395
+ @discardableResult
395
396
public static func runDetached< T> (
396
397
priority: Priority = . default,
397
398
startingOn executor: ExecutorRef ? = nil ,
@@ -447,6 +448,7 @@ extension Task {
447
448
/// - Returns: handle to the task, allowing to `await handle.get()` on the
448
449
/// tasks result or `cancel` it. If the operation fails the handle will
449
450
/// throw the error the operation has thrown when awaited on.
451
+ @discardableResult
450
452
public static func runDetached< T, Failure> (
451
453
priority: Priority = . default,
452
454
startingOn executor: ExecutorRef ? = nil ,
@@ -474,7 +476,7 @@ extension Task {
474
476
475
477
public func _runAsyncHandler( operation: @escaping ( ) async -> ( ) ) {
476
478
typealias ConcurrentFunctionType = @concurrent ( ) async -> ( )
477
- _ = Task . runDetached (
479
+ Task . runDetached (
478
480
operation: unsafeBitCast ( operation, to: ConcurrentFunctionType . self)
479
481
)
480
482
}
@@ -594,7 +596,7 @@ public func runAsyncAndBlock(_ asyncFun: @escaping () async -> ())
594
596
public func _async MainDrainQueue( ) -> Never
595
597
596
598
public func _runAsyncMain( _ asyncFun: @escaping ( ) async throws -> ( ) ) {
597
- let _ = Task . runDetached {
599
+ Task . runDetached {
598
600
do {
599
601
try await asyncFun ( )
600
602
exit ( 0 )
@@ -704,7 +706,7 @@ internal func _runTaskForBridgedAsyncMethod(_ body: @escaping () async -> Void)
704
706
// if we're already running on behalf of a task,
705
707
// if the receiver of the method invocation is itself an Actor, or in other
706
708
// situations.
707
- _ = Task . runDetached { await body ( ) }
709
+ Task . runDetached { await body ( ) }
708
710
}
709
711
710
712
#endif
0 commit comments