Skip to content

Cannot derive Reflect on a struct with Option<Box<T>> field where T: Reflect #10393

Description

@umut-sahin

Bevy version

v0.12

What you did

#[derive(Reflect)]
pub struct Foo<T: Reflect> {
    pub problem: Option<Box<T>>,
}

What went wrong

error[E0277]: the trait bound `std::boxed::Box<T>: TypePath` is not satisfied
  --> src/bug.rs:5:18
   |
25 |     pub problem: Option<Box<T>>,
   |                  ^^^^^^^^^^^^^^ the trait `TypePath` is not implemented for `std::boxed::Box<T>`
   |

Additional information

This was compiling on v0.11.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ReflectionRuntime information about typesC-UsabilityA targeted quality-of-life change that makes Bevy easier to use

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions