Skip to content

Commit dd698b9

Browse files
committed
Fix 7ca1f73 by allowing failure() to handle innerTask with different generic Error type to outerTask.
1 parent 7ca1f73 commit dd698b9

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
@@ -521,15 +521,15 @@ public class Task<Progress, Value, Error>: Cancellable, Printable
521521
/// - e.g. task.failure { errorInfo -> NextTaskType in ... }
522522
/// - e.g. task.failure { error, isCancelled -> NextTaskType in ... }
523523
///
524-
public func failure<Progress2>(failureClosure: ErrorInfo -> Task<Progress2, Value, Error>) -> Task<Progress2, Value, Error>
524+
public func failure<Progress2, Error2>(failureClosure: ErrorInfo -> Task<Progress2, Value, Error2>) -> Task<Progress2, Value, Error2>
525525
{
526526
var dummyCanceller: Canceller? = nil
527527
return self.failure(&dummyCanceller, failureClosure)
528528
}
529529

530-
public func failure<Progress2, C: Canceller>(inout canceller: C?, _ failureClosure: ErrorInfo -> Task<Progress2, Value, Error>) -> Task<Progress2, Value, Error>
530+
public func failure<Progress2, Error2, C: Canceller>(inout canceller: C?, _ failureClosure: ErrorInfo -> Task<Progress2, Value, Error2>) -> Task<Progress2, Value, Error2>
531531
{
532-
return Task<Progress2, Value, Error> { [unowned self] newMachine, progress, fulfill, _reject, configure in
532+
return Task<Progress2, Value, Error2> { [unowned self] newMachine, progress, fulfill, _reject, configure in
533533

534534
let selfMachine = self._machine
535535

0 commit comments

Comments
 (0)