#[reflect(Trait)]
on a generic struct can't conditionally reflect depending on generic parameters
#13385
Labels
A-Reflection
Runtime information about types
C-Usability
A simple quality-of-life change that makes Bevy easier to use
What problem does this solve or what need does it fill?
Typically a derive macro such as
PartialEq
is clever enough to only work when a struct's generic parameters implementPartialEq
, by adding trait bounds to the impl. It would be nice to do something similar withReflect
:Looking at the proc macro it's not immediately obvious to me how do this.
What solution would you like?
Some way of telling the
Reflect
macro to only reflect traits when the generic type implements them.Additional context
This came up in #13348 (comment) When resolved, open a trivial PR to add the
PartialEq
reflection.The text was updated successfully, but these errors were encountered: