From 508c1815c16008a13b24b52e2aa824ab8524208c Mon Sep 17 00:00:00 2001 From: Roman Podymov Date: Tue, 6 Oct 2020 23:05:56 +0200 Subject: [PATCH] Fix possible ambiguous use of when(fulfilled:) --- Tests/CorePromise/WhenTests.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Tests/CorePromise/WhenTests.swift b/Tests/CorePromise/WhenTests.swift index 69ccfaa40..9a6781ac7 100644 --- a/Tests/CorePromise/WhenTests.swift +++ b/Tests/CorePromise/WhenTests.swift @@ -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() } @@ -241,7 +242,8 @@ class WhenTests: XCTestCase { let p2 = Promise(error: Error.test2) let p3 = Promise(error: Error.test3) - when(fulfilled: p1, p2, p3).catch { error in + let whenFulfilledP1P2P3: Promise = when(fulfilled: p1, p2, p3) + whenFulfilledP1P2P3.catch { error in XCTAssertTrue(error as? Error == Error.test1) ex.fulfill() }