-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
#[export] infer VariantType
#147
#[export] infer VariantType
#147
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 is a great simplification, thank you!
Sorry for the merge conflicts, I changed the proc-macro insides yesterday. Could you rebase onto master and squash into a single commit? Let me know if you need any help 🙂
impl<T: VariantMetadata> VariantMetadata for Option<T> { | ||
fn variant_type() -> VariantType { | ||
T::variant_type() | ||
} | ||
} |
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.
We have to statically (at compile time) determine a variant type for a given Rust type.
Option::None
however would typically correspond to NIL
-- may that cause problems?
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.
As far as I can see it, every time you recive a Variant it could be NIL
even if you have declared another type.
For example if you reset a Property in the Inspector per default it gets set to NIL
.
c2c9ca0
to
67a68e4
Compare
bors r+ |
Build succeeded:
|
I removed the explicit
VariantType
declaration and replaced it with the ability to infer the same.Also added an implementation for
VariantMetadata
forOption
not sure if this is good but it was necessary.