Skip to content

Commit 80a3e4a

Browse files
committed
Make PromiseInitClosure @escaping
Seeing this error when using `PromiseInitClosure`: > Closure use of non-escaping parameter 'fulfill' may allow it to escape
1 parent fb4af8a commit 80a3e4a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

SwiftTask/SwiftTask.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ open class Task<Progress, Value, Error>: Cancellable, CustomStringConvertible
6767
public typealias RejectHandler = (Error) -> Void
6868
public typealias Configuration = TaskConfiguration
6969

70-
public typealias PromiseInitClosure = (_ fulfill: FulfillHandler, _ reject: RejectHandler) -> Void
70+
public typealias PromiseInitClosure = (_ fulfill: @escaping FulfillHandler, _ reject: @escaping RejectHandler) -> Void
7171
public typealias InitClosure = (_ progress: @escaping ProgressHandler, _ fulfill: @escaping FulfillHandler, _ reject: @escaping RejectHandler, _ configure: TaskConfiguration) -> Void
7272

7373
internal typealias _Machine = _StateMachine<Progress, Value, Error>

0 commit comments

Comments
 (0)