@@ -68,11 +68,11 @@ open class Task<Progress, Value, Error>: Cancellable, CustomStringConvertible
68
68
public typealias Configuration = TaskConfiguration
69
69
70
70
public typealias PromiseInitClosure = ( _ fulfill: FulfillHandler , _ reject: RejectHandler ) -> Void
71
- public typealias InitClosure = ( _ progress: ProgressHandler , _ fulfill: FulfillHandler , _ reject: RejectHandler , _ configure: TaskConfiguration ) -> Void
71
+ public typealias InitClosure = ( _ progress: @escaping ProgressHandler , _ fulfill: @escaping FulfillHandler , _ reject: @escaping RejectHandler , _ configure: TaskConfiguration ) -> Void
72
72
73
73
internal typealias _Machine = _StateMachine < Progress , Value , Error >
74
74
75
- internal typealias _InitClosure = ( _ machine: _Machine , _ progress: ProgressHandler , _ fulfill: FulfillHandler , _ _reject: _RejectInfoHandler , _ configure: TaskConfiguration ) -> Void
75
+ internal typealias _InitClosure = ( _ machine: _Machine , _ progress: @escaping ProgressHandler , _ fulfill: @escaping FulfillHandler , _ _reject: @escaping _RejectInfoHandler , _ configure: TaskConfiguration ) -> Void
76
76
77
77
internal typealias _ProgressTupleHandler = ( ProgressTuple ) -> Void
78
78
internal typealias _RejectInfoHandler = ( ErrorInfo ) -> Void
@@ -126,7 +126,7 @@ open class Task<Progress, Value, Error>: Cancellable, CustomStringConvertible
126
126
///
127
127
/// - Returns: New task.
128
128
///
129
- public init ( weakified: Bool , paused: Bool , initClosure: InitClosure )
129
+ public init ( weakified: Bool , paused: Bool , initClosure: @escaping InitClosure )
130
130
{
131
131
self . _weakified = weakified
132
132
self . _paused = paused
@@ -145,7 +145,7 @@ open class Task<Progress, Value, Error>: Cancellable, CustomStringConvertible
145
145
///
146
146
/// - e.g. Task<P, V, E>(paused: false) { progress, fulfill, reject, configure in ... }
147
147
///
148
- public convenience init ( paused: Bool , initClosure: InitClosure )
148
+ public convenience init ( paused: Bool , initClosure: @escaping InitClosure )
149
149
{
150
150
self . init ( weakified: false , paused: paused, initClosure: initClosure)
151
151
}
@@ -155,7 +155,7 @@ open class Task<Progress, Value, Error>: Cancellable, CustomStringConvertible
155
155
///
156
156
/// - e.g. Task<P, V, E> { progress, fulfill, reject, configure in ... }
157
157
///
158
- public convenience init ( initClosure: InitClosure )
158
+ public convenience init ( initClosure: @escaping InitClosure )
159
159
{
160
160
self . init ( weakified: false , paused: false , initClosure: initClosure)
161
161
}
@@ -191,7 +191,7 @@ open class Task<Progress, Value, Error>: Cancellable, CustomStringConvertible
191
191
///
192
192
/// - e.g. Task<Any, Value, Error> { fulfill, reject in ... }
193
193
///
194
- public convenience init ( promiseInitClosure: PromiseInitClosure )
194
+ public convenience init ( promiseInitClosure: @escaping PromiseInitClosure )
195
195
{
196
196
self . init ( initClosure: { progress, fulfill, reject, configure in
197
197
promiseInitClosure ( fulfill, { error in reject ( error) } )
@@ -200,7 +200,7 @@ open class Task<Progress, Value, Error>: Cancellable, CustomStringConvertible
200
200
201
201
/// internal-init for accessing `machine` inside `_initClosure`
202
202
/// (NOTE: _initClosure has _RejectInfoHandler as argument)
203
- internal init ( weakified: Bool = false , paused: Bool = false , _initClosure: _InitClosure )
203
+ internal init ( weakified: Bool = false , paused: Bool = false , _initClosure: @escaping _InitClosure )
204
204
{
205
205
self . _weakified = weakified
206
206
self . _paused = paused
@@ -210,7 +210,7 @@ open class Task<Progress, Value, Error>: Cancellable, CustomStringConvertible
210
210
}
211
211
212
212
// NOTE: don't use `internal init` for this setup method, or this will be a designated initializer
213
- internal func setup( weakified: Bool , paused: Bool , _initClosure: _InitClosure )
213
+ internal func setup( weakified: Bool , paused: Bool , _initClosure: @escaping _InitClosure )
214
214
{
215
215
// #if DEBUG
216
216
// let addr = String(format: "%p", unsafeAddressOf(self))
@@ -620,9 +620,9 @@ open class Task<Progress, Value, Error>: Cancellable, CustomStringConvertible
620
620
internal func _bindInnerTask< Progress2, Value2, Error, Error2> (
621
621
_ innerTask: Task < Progress2 , Value2 , Error2 > ,
622
622
_ newMachine: _StateMachine < Progress2 , Value2 , Error > ,
623
- _ progress: Task < Progress2 , Value2 , Error > . ProgressHandler ,
624
- _ fulfill: Task < Progress2 , Value2 , Error > . FulfillHandler ,
625
- _ _reject: Task < Progress2 , Value2 , Error > . _RejectInfoHandler ,
623
+ _ progress: @escaping Task < Progress2 , Value2 , Error > . ProgressHandler ,
624
+ _ fulfill: @escaping Task < Progress2 , Value2 , Error > . FulfillHandler ,
625
+ _ _reject: @escaping Task < Progress2 , Value2 , Error > . _RejectInfoHandler ,
626
626
_ configure: TaskConfiguration
627
627
)
628
628
{
0 commit comments