bevy/crates/bevy_reflect/src
Wuketuke 2eb9d5cc38
hashing error in bevy_reflect now includes the type (bevyengine#13646) (#13691)
# Objective
If you try to add an object to the hashmap that is not capable of
hashing, the program panics. For easier debugging, the type for that
object should be included in the error message.

Fixes #13646.

## Solution
initially i tried calling std::any::type_name_of_val. this had the
problem that it would print something like dyn Box<dyn Reflect>, not
helpful. But since these objects all implement Reflect, i used
Reflect::type_path() instead. Previously, the error message was part of
a constant called HASH_ERROR. i changed that to a macro called
hash_error to print the type of that object more easily

## Testing
i adapted the unit test reflect_map_no_hash to expect the type in that
panic aswell

since this is my first contribution, please let me know if i have done
everything properly
2024-06-05 19:41:23 +00:00
..
enums bevy_reflect: Custom attributes (#11659) 2024-05-20 19:30:21 +00:00
impls Move bevy_math Reflect impls (#13520) 2024-05-27 14:15:22 +00:00
path Add on_unimplemented Diagnostics to Most Public Traits (#13347) (#13662) 2024-06-04 00:31:34 +00:00
serde bevy_reflect: Rename UntypedReflectDeserializer to ReflectDeserializer (#12721) 2024-03-26 19:58:29 +00:00
array.rs Avoid bevy_reflect::List::iter wrapping in release mode (#13271) 2024-05-12 15:01:05 +00:00
attributes.rs bevy_reflect: Custom attributes (#11659) 2024-05-20 19:30:21 +00:00
fields.rs bevy_reflect: Custom attributes (#11659) 2024-05-20 19:30:21 +00:00
from_reflect.rs Add on_unimplemented Diagnostics to Most Public Traits (#13347) (#13662) 2024-06-04 00:31:34 +00:00
lib.rs hashing error in bevy_reflect now includes the type (bevyengine#13646) (#13691) 2024-06-05 19:41:23 +00:00
list.rs Avoid bevy_reflect::List::iter wrapping in release mode (#13271) 2024-05-12 15:01:05 +00:00
map.rs hashing error in bevy_reflect now includes the type (bevyengine#13646) (#13691) 2024-06-05 19:41:23 +00:00
reflect.rs Add on_unimplemented Diagnostics to Most Public Traits (#13347) (#13662) 2024-06-04 00:31:34 +00:00
std_traits.rs
struct_trait.rs bevy_reflect: Custom attributes (#11659) 2024-05-20 19:30:21 +00:00
tuple_struct.rs bevy_reflect: Custom attributes (#11659) 2024-05-20 19:30:21 +00:00
tuple.rs Avoid bevy_reflect::List::iter wrapping in release mode (#13271) 2024-05-12 15:01:05 +00:00
type_info.rs Add on_unimplemented Diagnostics to Most Public Traits (#13347) (#13662) 2024-06-04 00:31:34 +00:00
type_path.rs Add on_unimplemented Diagnostics to Most Public Traits (#13347) (#13662) 2024-06-04 00:31:34 +00:00
type_registry.rs Add on_unimplemented Diagnostics to Most Public Traits (#13347) (#13662) 2024-06-04 00:31:34 +00:00
utility.rs Finish the work on try_apply (#12646) 2024-05-08 14:26:01 +00:00