-
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
()
not Serializable
#88
Comments
Based on @arendjr adding the |
I'll pick this up. |
@Sushisource could you share the struct definition that wasn't working for you? |
Even just this will do it: use fp_bindgen::prelude::*;
#[derive(Serializable)]
struct Foo {
hi: ()
} Results in:
|
@Sushisource thanks for sharing. I'm currently doing some work to allow unit types to be used in return types (e.g. |
Yeah, the use case is a generic struct like this: use fp_bindgen::prelude::*;
#[derive(Serializable)]
struct Foo<T> {
hi: T
} Where some reification of that struct might reasonably want to use the unit type because it happens not to care about populating that field meaningfully |
Hey all, starting playing around with this, looks very cool.
Ran into the problem in the title almost right away though, which was rather surprising. I assume just an oversight, but would be nice to have.
Additionally when I first tried writing a generic
Serializable
struct, I added bounds to the generic forT: Serializable
which I would expect to be necessary, but the macro seems to break on that (and if you remove it, appears to silently enforce it). It'd be good to allow that, or have a more explicit error.Thanks!
The text was updated successfully, but these errors were encountered: