Skip to content

Commit 5818dcb

Browse files
committed
Use empty tuple instead of Void in Task to support Swift 4.
1 parent 6861a87 commit 5818dcb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/BoltsSwift/Task.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public final class Task<TResult> {
9393
}
9494

9595
class func emptyTask() -> Task<Void> {
96-
return Task<Void>(state: .success())
96+
return Task<Void>(state: .success(()))
9797
}
9898

9999
// MARK: Execute
@@ -107,7 +107,7 @@ public final class Task<TResult> {
107107
- parameter closure: The closure that returns the result of the task.
108108
The returned task will complete when the closure completes.
109109
*/
110-
public convenience init(_ executor: Executor = .default, closure: @escaping ((Void) throws -> TResult)) {
110+
public convenience init(_ executor: Executor = .default, closure: @escaping (() throws -> TResult)) {
111111
self.init(state: .pending())
112112
executor.execute {
113113
self.trySet(state: TaskState.fromClosure(closure))
@@ -123,7 +123,7 @@ public final class Task<TResult> {
123123

124124
- returns: A task that will continue with the task returned by the given closure.
125125
*/
126-
public class func execute(_ executor: Executor = .default, closure: @escaping ((Void) throws -> TResult)) -> Task {
126+
public class func execute(_ executor: Executor = .default, closure: @escaping (() throws -> TResult)) -> Task {
127127
return Task(executor, closure: closure)
128128
}
129129

0 commit comments

Comments
 (0)