-
Notifications
You must be signed in to change notification settings - Fork 18
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
Allow functions with return type '-> ()' to be bound #123
Conversation
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.
This looks like a good improvement 👍
I do wonder, let's say we face a return type such as Result<(), Error>
, wouldn't that still be an issue if ()
doesn't implement Serializable
?
Fair enough, I don't think cases like |
@arendjr this seems good to go. |
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.
Nice work!
pub fn import_void_function_empty_result() -> Result<(), u32>; | ||
|
||
#[fp_bindgen_support::fp_import_signature] | ||
pub fn import_void_function_empty_return(); |
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.
I think this is functionally a duplicate of import_void_function()
:)
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.
Agreed, but the protocol specifies a -> ()
return type here, which gets omitted during codegen. Once that is done, the two functions are indeed identical.
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.
Good point, I overlooked that 👍
This deals with one part of #88. I'll handle the
T: Serializable
generic bound in another pull request.