-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fix possible ambiguous use of when(fulfilled:) in tests #1171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.