Skip to content
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

Promise.value and Guarantee.value when T == Void #1096

Merged
merged 9 commits into from
Sep 25, 2019
Merged

Promise.value and Guarantee.value when T == Void #1096

merged 9 commits into from
Sep 25, 2019

Conversation

RomanPodymov
Copy link
Collaborator

Hello.
Thank you for PromiseKit.
I see that Resolver has func fulfill_() for T == Void. I would propose to add similar functions for Promise and Guarantee.
Also, declared func Promise.value() as static because Promise is final.

@mxcl
Copy link
Owner

mxcl commented Sep 24, 2019

Thanks, this is a good addition.

Can we get a test that verifies that this is not ambiguous for any version of Swift we support?

ie:

func test() {
    // tests no amiguity
    let a = Promise<Void>.value
    let b = Promise<Void>.value(Void())
}

Thanks.

@RomanPodymov
Copy link
Collaborator Author

Thanks, this is a good addition.

Can we get a test that verifies that this is not ambiguous for any version of Swift we support?

ie:

func test() {
    // tests no amiguity
    let a = Promise<Void>.value
    let b = Promise<Void>.value(Void())
}

Thanks.

Hello @mxcl
Done.

@mxcl mxcl merged commit 10a10ed into mxcl:master Sep 25, 2019
@mxcl
Copy link
Owner

mxcl commented Sep 25, 2019

Marvelous thank you for your contribution!

caldrian pushed a commit to codestruction-eu/PromiseKit that referenced this pull request Nov 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants