-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Issue with specific reflect breaking after upgrading from 0.9-0.10 #7989
Labels
Milestone
Comments
CoffeeVampir3
added
C-Bug
An unexpected or incorrect behavior
S-Needs-Triage
This issue needs to be labelled
labels
Mar 9, 2023
After expanding the macro I think I've found the issue: The emitted version of the macro (one example) #[allow(unused_mut)]
impl <T>bevy::reflect::GetTypeRegistration for NetSet<T>where T:'static+Send+Sync+Eq+Copy+core::hash::Hash HashSet<T> :bevy::reflect::Reflect,{
fn get_type_registration() -> bevy::reflect::TypeRegistration {
let mut registration = bevy::reflect::TypeRegistration::of:: <NetSet<T> >();
registration.insert:: <bevy::reflect::ReflectFromPtr>(bevy::reflect::FromType:: <NetSet<T> > ::from_type());
let ignored_indices = ::core::iter::IntoIterator::into_iter([]);
registration.insert:: <bevy::reflect::serde::SerializationData>(bevy::reflect::serde::SerializationData::new(ignored_indices));
registration
} there's a missing comma on the reflect emit it appears. gunna dig into the reflect proc macro and see if I can get it to work. |
JMS55
added
A-Reflection
Runtime information about types
and removed
S-Needs-Triage
This issue needs to be labelled
labels
Mar 9, 2023
Closing in favor of #8014 |
Lol closed the issue instead of the PR 🤦♂️ |
mockersf
pushed a commit
that referenced
this issue
Mar 27, 2023
# Objective Fixes #7989 Based on #7991 by @CoffeeVampir3 ## Solution There were three parts to this issue: 1. `extend_where_clause` did not account for the optionality of a where clause's trailing comma ```rust // OKAY struct Foo<T> where T: Asset, {/* ... */} // ERROR struct Foo<T> where T: Asset {/* ... */} ``` 2. `FromReflect` derive logic was not actively using `extend_where_clause` which led to some inconsistencies (enums weren't adding _any_ additional bounds even) 3. Using `extend_where_clause` in the `FromReflect` derive logic meant we had to optionally add `Default` bounds to ignored fields iff the entire item itself was not already `Default` (otherwise the definition for `Handle<T>` wouldn't compile since `HandleType` doesn't impl `Default` but `Handle<T>` itself does) --- ## Changelog - Fixed issue where a missing trailing comma could break the reflection derives
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bevy 0.10
0.10
What you did
Upgraded from bevy 0.9 -> 0.10
What went wrong
The following code has stopped compiling:
There's an error for the reflect derive,
and one for the HashSet
Additional information
Full 0.9 version: https://github.com/CoffeeVampir3/rusty_cg/blob/main/src/structures/netset.rs
Fully expanded proc macro:
The text was updated successfully, but these errors were encountered: