Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WorldQuery macro hygiene is poor #6593

Closed
bzm3r opened this issue Nov 13, 2022 · 0 comments
Closed

WorldQuery macro hygiene is poor #6593

bzm3r opened this issue Nov 13, 2022 · 0 comments
Labels
A-ECS Entities, components, systems, and events C-Bug An unexpected or incorrect behavior

Comments

@bzm3r
Copy link
Contributor

bzm3r commented Nov 13, 2022

Bevy version

0.9

What you did

Trying to derive WorldQuery on something.

What went wrong

Got the following error:

error[E0412]: cannot find type `Entity` in this scope
  --> src\ability_state.rs:24:10
   |
24 | #[derive(WorldQuery)]
   |          ^^^^^^^^^^ not found in this scope
   |
   = note: this error originates in the derive macro `WorldQuery` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing one of these items
   |
4  | use bevy::ecs::entity::Entity;
   |
4  | use crate::Entity;
   |

Additional information

Importing Entity, using use bevy::ecs::entity:Entity allows the macro to see it, but this is a hygiene issue because the macro should use fully qualified paths to Entity.

@bzm3r bzm3r added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Nov 13, 2022
@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events and removed S-Needs-Triage This issue needs to be labelled labels Nov 13, 2022
@bors bors bot closed this as completed in 1967c3d Nov 14, 2022
taiyoungjang pushed a commit to taiyoungjang/bevy that referenced this issue Dec 15, 2022
# Objective

Fix bevyengine#6593

## Solution

Fully qualify `Entity` in the `WorldQuery` macro
alradish pushed a commit to alradish/bevy that referenced this issue Jan 22, 2023
# Objective

Fix bevyengine#6593

## Solution

Fully qualify `Entity` in the `WorldQuery` macro
ItsDoot pushed a commit to ItsDoot/bevy that referenced this issue Feb 1, 2023
# Objective

Fix bevyengine#6593

## Solution

Fully qualify `Entity` in the `WorldQuery` macro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants