Skip to content

Commit

Permalink
Fix possible ambiguous use of when(fulfilled:) (#1171)
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanPodymov committed May 24, 2021
1 parent 6e010ff commit 41e78ba
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Tests/CorePromise/WhenTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ class WhenTests: XCTestCase {
let p2 = after(.milliseconds(100)).done { throw Error.straggler }
let p3 = after(.milliseconds(200)).done { throw Error.straggler }

when(fulfilled: p1, p2, p3).catch { error -> Void in
let whenFulfilledP1P2P3: Promise<(Void, Void, Void)> = when(fulfilled: p1, p2, p3)
whenFulfilledP1P2P3.catch { error -> Void in
XCTAssertTrue(Error.test == error as? Error)
ex1.fulfill()
}
Expand All @@ -241,7 +242,8 @@ class WhenTests: XCTestCase {
let p2 = Promise<Void>(error: Error.test2)
let p3 = Promise<Void>(error: Error.test3)

when(fulfilled: p1, p2, p3).catch { error in
let whenFulfilledP1P2P3: Promise<Void> = when(fulfilled: p1, p2, p3)
whenFulfilledP1P2P3.catch { error in
XCTAssertTrue(error as? Error == Error.test1)
ex.fulfill()
}
Expand Down

0 comments on commit 41e78ba

Please sign in to comment.