-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Open
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorD-ComplexQuite challenging from either a design or technical perspective. Ask for help!Quite challenging from either a design or technical perspective. Ask for help!P-RegressionFunctionality that used to work but no longer does. Add a test for this!Functionality that used to work but no longer does. Add a test for this!S-Needs-DesignThis issue requires design work to think about how it would best be accomplishedThis issue requires design work to think about how it would best be accomplished
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
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorD-ComplexQuite challenging from either a design or technical perspective. Ask for help!Quite challenging from either a design or technical perspective. Ask for help!P-RegressionFunctionality that used to work but no longer does. Add a test for this!Functionality that used to work but no longer does. Add a test for this!S-Needs-DesignThis issue requires design work to think about how it would best be accomplishedThis issue requires design work to think about how it would best be accomplished