bevy_reflect: Fix trailing comma breaking derives #8014
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Objective
Fixes #7989
Based on #7991 by @CoffeeVampir3
Solution
There were three parts to this issue:
extend_where_clause
did not account for the optionality of a where clause's trailing commaFromReflect
derive logic was not actively usingextend_where_clause
which led to some inconsistencies (enums weren't adding any additional bounds even)extend_where_clause
in theFromReflect
derive logic meant we had to optionally addDefault
bounds to ignored fields iff the entire item itself was not alreadyDefault
(otherwise the definition forHandle<T>
wouldn't compile sinceHandleType
doesn't implDefault
butHandle<T>
itself does)Changelog