Open
Description
Bevy version
Bevy 0.16
What you did
This is a follow up to this discussion.
The following code no longer compiles as of Bevy 0.16:
use bevy::prelude::*;
#[derive(Bundle)]
struct Foo<T: Bundle>(T);
error[E0277]: the trait bound `T: BundleFromComponents` is not satisfied
I understand this requires BundleFromComponent
trait bound to work because of the new changes to Bundles:
use bevy::prelude::*;
use bevy::ecs::bundle::BundleFromComponents;
#[derive(Bundle)]
struct Foo<T: Bundle + BundleFromComponents>(T);
However, as discussed, this feels like a regression since BundleFromComponents
is mostly an implementation detail (to me, at least).
Additional information
Some solutions that come to my mind:
- We could have
Bundle
requireBundleFromComponents
as a trait bound. But this makes me wonder why this trait was split out to begin with. - We could introduce a new
CompleteBundle
trait (naming is hard) which does requireBundleFromComponent
and changederive(Bundle)
toderive(CompleteBundle)
instead.
Metadata
Metadata
Assignees
Labels
Entities, components, systems, and eventsAn unexpected or incorrect behaviorQuite challenging from either a design or technical perspective. Ask for help!Functionality that used to work but no longer does. Add a test for this!This issue requires design work to think about how it would best be accomplished