@@ -377,6 +377,7 @@ extension Task {
377
377
/// - Returns: handle to the task, allowing to `await handle.get()` on the
378
378
/// tasks result or `cancel` it. If the operation fails the handle will
379
379
/// throw the error the operation has thrown when awaited on.
380
+ @discardableResult
380
381
public static func runDetached< T> (
381
382
priority: Priority = . default,
382
383
startingOn executor: ExecutorRef ? = nil ,
@@ -431,6 +432,7 @@ extension Task {
431
432
/// - Returns: handle to the task, allowing to `await handle.get()` on the
432
433
/// tasks result or `cancel` it. If the operation fails the handle will
433
434
/// throw the error the operation has thrown when awaited on.
435
+ @discardableResult
434
436
public static func runDetached< T, Failure> (
435
437
priority: Priority = . default,
436
438
startingOn executor: ExecutorRef ? = nil ,
@@ -458,7 +460,7 @@ extension Task {
458
460
459
461
public func _runAsyncHandler( operation: @escaping ( ) async -> ( ) ) {
460
462
typealias ConcurrentFunctionType = @concurrent ( ) async -> ( )
461
- _ = Task . runDetached (
463
+ Task . runDetached (
462
464
operation: unsafeBitCast ( operation, to: ConcurrentFunctionType . self)
463
465
)
464
466
}
@@ -578,7 +580,7 @@ public func runAsyncAndBlock(_ asyncFun: @escaping () async -> ())
578
580
public func _async MainDrainQueue( ) -> Never
579
581
580
582
public func _runAsyncMain( _ asyncFun: @escaping ( ) async throws -> ( ) ) {
581
- let _ = Task . runDetached {
583
+ Task . runDetached {
582
584
do {
583
585
try await asyncFun ( )
584
586
exit ( 0 )
@@ -680,7 +682,7 @@ internal func _runTaskForBridgedAsyncMethod(_ body: @escaping () async -> Void)
680
682
// if we're already running on behalf of a task,
681
683
// if the receiver of the method invocation is itself an Actor, or in other
682
684
// situations.
683
- _ = Task . runDetached { await body ( ) }
685
+ Task . runDetached { await body ( ) }
684
686
}
685
687
686
688
#endif
0 commit comments