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

Crash when returning primitive types #4

Closed
robinwit opened this issue Apr 23, 2014 · 3 comments
Closed

Crash when returning primitive types #4

robinwit opened this issue Apr 23, 2014 · 3 comments

Comments

@robinwit
Copy link
Contributor

dispatch_promise(^{
    return 3;
}).then(^(NSInteger i) {
    //
});

This crashes here since the return type is obviously not id.
I don't know what's the cleanest way to solve this. It's kind of acceptable that primitive types don't work. Maybe even leave it as-is and update the docs, or start supporting it?

(I caught this when accidentally returning "string" instead of @"string". 🙈)

@mxcl
Copy link
Owner

mxcl commented Apr 23, 2014

I actually can handle this, so I will. Let’s be delightful!

@robinwit
Copy link
Contributor Author

👍
Here's a Belgian beer of your choice: 🍺 !

@mxcl mxcl closed this as completed in 31ba0aa Apr 24, 2014
@nickynick
Copy link

@mxcl Thought I'd throw my five cents in - if you don't mind a dependency on libffi, it is definitely possible to have primitive types as parameters as well. Like this!

@JQHee JQHee mentioned this issue May 2, 2018
RomanPodymov added a commit that referenced this issue Jun 1, 2024
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

No branches or pull requests

3 participants