Skip to content

Commit b3a7d34

Browse files
committed
Fix 0bea15f by allowing then() to handle any innerTask types including any generic Error types.
1 parent 0bea15f commit b3a7d34

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

SwiftTask/SwiftTask.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ public class Task<Progress, Value, Error>: Cancellable, Printable
398398
///
399399
/// - e.g. task.then { value, errorInfo -> NextTaskType in ... }
400400
///
401-
public func then<Progress2, Value2>(thenClosure: (Value?, ErrorInfo?) -> Task<Progress2, Value2, Error>) -> Task<Progress2, Value2, Error>
401+
public func then<Progress2, Value2, Error2>(thenClosure: (Value?, ErrorInfo?) -> Task<Progress2, Value2, Error2>) -> Task<Progress2, Value2, Error2>
402402
{
403403
var dummyCanceller: Canceller? = nil
404404
return self.then(&dummyCanceller, thenClosure)
@@ -410,9 +410,9 @@ public class Task<Progress, Value, Error>: Cancellable, Printable
410410
// - `let canceller = Canceller(); task1.then(&canceller) {...}; canceller.cancel();`
411411
// - `let task2 = task1.then {...}; task2.cancel();`
412412
//
413-
public func then<Progress2, Value2, C: Canceller>(inout canceller: C?, _ thenClosure: (Value?, ErrorInfo?) -> Task<Progress2, Value2, Error>) -> Task<Progress2, Value2, Error>
413+
public func then<Progress2, Value2, Error2, C: Canceller>(inout canceller: C?, _ thenClosure: (Value?, ErrorInfo?) -> Task<Progress2, Value2, Error2>) -> Task<Progress2, Value2, Error2>
414414
{
415-
return Task<Progress2, Value2, Error> { [unowned self, weak canceller] newMachine, progress, fulfill, _reject, configure in
415+
return Task<Progress2, Value2, Error2> { [unowned self, weak canceller] newMachine, progress, fulfill, _reject, configure in
416416

417417
//
418418
// NOTE:

0 commit comments

Comments
 (0)