-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Open
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorD-MacrosCode that generates Rust codeCode that generates Rust codeS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!X-UncontroversialThis work is generally agreed uponThis work is generally agreed upon
Description
hello !
Bevy version
bevy 0.16.0
If your bug is rendering-related, copy the adapter info that appears when you run Bevy.
What you did
#[derive(Component)]
pub enum TroopState {
Idle,
#[entities] // should error
Run(Option<Target>),
#[entities] // should error
Attack(Target),
}
#[derive(Component)]
pub struct Target {
#[entities]
pub entity: Entity,
}
Target
is not mapped, this is a footgun, without any warning
What went wrong
the #[entities]
should be on the associated type like so Run(#[entities] Option<Target>)
maybe the derive macro can error when the annotation is on the enum variant instead of actual type ?
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorD-MacrosCode that generates Rust codeCode that generates Rust codeS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!X-UncontroversialThis work is generally agreed uponThis work is generally agreed upon