mirror of
https://github.com/bevyengine/bevy
synced 2024-12-26 21:13:09 +00:00
5b00af01d7
# Objective Currently, arrays cannot indexed using the reflection path API. This change makes them behave like lists so `x.get_path("list[0]")` will behave the same way, whether x.list is a "List" (e.g. a Vec) or an array. ## Solution When syntax is encounterd `[ <idx> ]` we check if the referenced type is either a `ReflectRef::List` or `ReflectRef::Array` (or `ReflectMut` for the mutable case). Since both provide the identical API for accessing entries, we do the same for both, although it requires code duplication as far as I can tell. This was born from working on #5764, but since this seems to be an easier fix (and I am not sure if I can actually solve #5812) I figured it might be worth to split this out. |
||
---|---|---|
.. | ||
enums | ||
impls | ||
serde | ||
array.rs | ||
fields.rs | ||
lib.rs | ||
list.rs | ||
map.rs | ||
path.rs | ||
reflect.rs | ||
std_traits.rs | ||
struct_trait.rs | ||
tuple.rs | ||
tuple_struct.rs | ||
type_info.rs | ||
type_registry.rs | ||
type_uuid.rs | ||
utility.rs |