dynamic_types.rs example panics when run due to failed assert

Open Beginner friendly
#24,983 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
rust
Domain
game-dev, testing

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.

Description

A-Reflection C-Docs C-Examples D-Modest S-Ready-For-Implementation X-Uncontroversial

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.

Dominant language
Rust
Stars
48.3k
Forks
4.9k
Avg merge
3d 17h
Merged PRs (30d)
172

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bevyengine/bevy

All issues in bevyengine/bevy

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.