@@ -19,6 +19,7 @@ import Foundation
1919 /// - operation: An asynchronous operation to execute within the task. The operation
2020 /// inherits the current actor context and is isolated to that actor.
2121 /// - Returns: A `Task` object that wraps the result or error of the operation.
22+ @discardableResult
2223 func task< Success: Sendable > (
2324 priority: TaskPriority ? ,
2425 @_inheritActorContext operation: sending @escaping @isolated ( any) ( ) async throws -> Success
@@ -30,6 +31,7 @@ import Foundation
3031 /// - operation: An asynchronous operation to execute within the task. The operation
3132 /// inherits the current actor context and is isolated to that actor.
3233 /// - Returns: A `Task` object that wraps the result of the operation.
34+ @discardableResult
3335 func task< Success: Sendable > (
3436 priority: TaskPriority ? ,
3537 @_inheritActorContext operation: sending @escaping @isolated ( any) ( ) async -> Success
@@ -42,6 +44,7 @@ import Foundation
4244 /// - operation: An asynchronous operation to execute within the task. The operation
4345 /// is isolated and does not inherit the current actor context.
4446 /// - Returns: A `Task` object that wraps the result or error of the operation.
47+ @discardableResult
4548 func detached< Success: Sendable > (
4649 priority: TaskPriority ? ,
4750 @_inheritActorContext operation: sending @escaping @isolated ( any) ( ) async throws -> Success
@@ -54,6 +57,7 @@ import Foundation
5457 /// - operation: An asynchronous operation to execute within the task. The operation
5558 /// is isolated and does not inherit the current actor context.
5659 /// - Returns: A `Task` object that wraps the result of the operation.
60+ @discardableResult
5761 func detached< Success: Sendable > (
5862 priority: TaskPriority ? ,
5963 @_inheritActorContext operation: sending @escaping @isolated ( any) ( ) async -> Success
@@ -66,6 +70,7 @@ import Foundation
6670 /// that can throw errors.
6771 /// - Parameter operation: An asynchronous operation to execute within the task.
6872 /// - Returns: A `Task` object that wraps the result or error of the operation.
73+ @discardableResult
6974 func task< Success: Sendable > (
7075 @_inheritActorContext operation: sending @escaping @isolated ( any) ( ) async throws -> Success
7176 ) -> Task < Success , Error > {
@@ -76,6 +81,7 @@ import Foundation
7681 /// that does not throw errors.
7782 /// - Parameter operation: An asynchronous operation to execute within the task.
7883 /// - Returns: A `Task` object that wraps the result of the operation.
84+ @discardableResult
7985 func task< Success: Sendable > (
8086 @_inheritActorContext operation: sending @escaping @isolated ( any) ( ) async -> Success
8187 ) -> Task < Success , Never > {
@@ -86,6 +92,7 @@ import Foundation
8692 /// of the current actor context and can throw errors.
8793 /// - Parameter operation: An asynchronous operation to execute within the task.
8894 /// - Returns: A `Task` object that wraps the result or error of the operation.
95+ @discardableResult
8996 func detached< Success: Sendable > (
9097 @_inheritActorContext operation: sending @escaping @isolated ( any) ( ) async throws -> Success
9198 ) -> Task < Success , Error > {
@@ -96,6 +103,7 @@ import Foundation
96103 /// of the current actor context and does not throw errors.
97104 /// - Parameter operation: An asynchronous operation to execute within the task.
98105 /// - Returns: A `Task` object that wraps the result of the operation.
106+ @discardableResult
99107 func detached< Success: Sendable > (
100108 @_inheritActorContext operation: sending @escaping @isolated ( any) ( ) async -> Success
101109 ) -> Task < Success , Never > {
0 commit comments