Fix possible ambiguous use of when(fulfilled:) in tests#1171
Fix possible ambiguous use of when(fulfilled:) in tests#1171mxcl merged 2 commits intomxcl:masterfrom RomanPodymov:fix/tests
Conversation
| 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) |
There was a problem hiding this comment.
There can be also let whenFulfilledP1P2P3: Promise<Void> = when(fulfilled: p1, p2, p3).
| let p3 = Promise<Void>(error: Error.test3) | ||
|
|
||
| when(fulfilled: p1, p2, p3).catch { error in | ||
| let whenFulfilledP1P2P3: Promise<Void> = when(fulfilled: p1, p2, p3) |
There was a problem hiding this comment.
There can be also let whenFulfilledP1P2P3: Promise<(Void, Void, Void)> = when(fulfilled: p1, p2, p3).
caddf7d to
0122f95
Compare
|
Forgive me, but I don’t see how this is ambiguous, ambiguous with which other version of when? |
Update code
|
Hello @mxcl As I can see in the debugger Maybe there is a rule why |
|
Oh ok. I’m not sure it matters per se, but why not. |
Hello.
Thank you for PromiseKit.
I found out that in
testUnhandledErrorHandlerDoesNotFireForStragglersandtestAllSealedRejectedFirstOneRejectsit is hard to determine which version ofwhen(fulfilled:)is being used. As for me, there should be the ambiguous use of when(fulfilled:) error. My suggestion is to storewhen(fulfilled: p1, p2, p3)'s result in a variable, it helps to know which version ofwhen(fulfilled:)is being used.