dynamic_types.rs example panics when run due to failed assert
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
Originally noticed by @ChristopherBiscardi in https://github.com/bevyengine/bevy/pull/24748#discussion_r3570195791_
The assert in question: https://github.com/bevyengine/bevy/blob/6d4f6979cf018ab84c7f630b7192577c62afdda5/examples/reflection/dynamic_types.rs#L103
This is actually a regression from #21137 by @SkiFire13 (<3), not the fault of #24748 and is broken on main: the pattern documented as broken in that example now works, and so asserting that it's none is incorrect!
## Solution
We should update this example, and the doc test for TypedReflectDeserializer, to match the actual implemented logic.
Contributor guide
Research direction
Start with examples/reflection/dynamic_types.rs at the assert linked in the issue, then find the TypedReflectDeserializer doc test. Run the example and relevant doc test to reproduce the panic; done means both match the implemented logic and pass without asserting the now-working pattern is None.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- game-dev, testing
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100