-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
reflect: remove manual Reflect impls which could be handled by macros #12596
Conversation
Co-authored-by: James Liu <[email protected]>
@@ -77,7 +71,8 @@ bitflags::bitflags! { | |||
/// [discussion about memory management](https://github.com/WebAssembly/design/issues/1397) for more | |||
/// details. | |||
#[repr(transparent)] | |||
#[derive(Serialize, TypePath, Deserialize, Hash, Clone, Copy, PartialEq, Eq, Debug)] | |||
#[derive(Serialize, Deserialize, Hash, Clone, Copy, PartialEq, Eq, Debug, Reflect)] | |||
#[reflect_value(Serialize, Deserialize, Hash, PartialEq, Debug)] |
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 had some issues with this, the suggested changes here https://github.com/bevyengine/bevy/pull/12025/files#r1518749863 wouldn't allow both reflect
and reflect_value
.
If I used reflect
I ended up with errors like
the trait
bevy_reflect::FromReflect
is not implemented forrender_asset::_::InternalBitFlags
, which is required byRenderAssetUsages: bevy_reflect::FromReflect
It also didn't like Reflect
being there, so I made it reflect_value
and removed Reflect
from the list
@@ -996,252 +995,14 @@ impl<T: Reflect + TypePath + GetTypeRegistration, const N: usize> GetTypeRegistr | |||
} | |||
} | |||
|
|||
impl<T: FromReflect + TypePath + GetTypeRegistration> GetTypeRegistration for Option<T> { |
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.
Most of the conflicts were from the + GetTypeRegistration
which didn't exist before
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.
thank you.
Objective
Reflect
impls which could be handled by macros #12025 to fix merge conflictsSolution
dynamic_linking
feature is used #9747), I checked these are resolved by using #[reflect_value].