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

reflect: remove manual Reflect impls which could be handled by macros #12596

Merged
merged 4 commits into from
Mar 23, 2024

Conversation

OneFourth
Copy link
Contributor

Objective

Solution

@@ -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)]
Copy link
Contributor Author

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 for render_asset::_::InternalBitFlags, which is required by RenderAssetUsages: 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> {
Copy link
Contributor Author

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

Copy link
Contributor

@soqb soqb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you.

@MrGVSV MrGVSV added C-Code-Quality A section of code that is hard to understand or change S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it A-Reflection Runtime information about types labels Mar 20, 2024
@james7132 james7132 added this pull request to the merge queue Mar 23, 2024
Merged via the queue into bevyengine:main with commit fdf2ea7 Mar 23, 2024
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Reflection Runtime information about types C-Code-Quality A section of code that is hard to understand or change S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants