Open
Description
Following the reproduction here, this code:
use bevy::prelude::*;
#[derive(Component)]
struct A;
#[derive(Component)]
struct B;
// The user needs to include both &A and &B in the first type parameter of Query
fn missing_brackets_in_query_system(query: Query<&A, &B>) {}
fn main() {
App::new()
.add_system(missing_brackets_in_query_system)
.run()
}
Produces the following error:
type mismatch resolving `for<'w, 's> <ReadFetch<B> as Fetch<'w, 's>>::Item == bool`
required because of the requirements on the impl of `FilterFetch` for `ReadFetch<B>`
In this case, the user should be grouping &A, &B
into the first type argument of Query
using our all_tuples
-impl'ed macro.
The compiler however sees that &B
is used in the place of the query filter, and complains that it's an invalid query due to missing internal traits.
Obviously, implementing FilterFetch
or ReadFetch
for B
is not the approach the user should be taking to solve this problem!
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: Type systemDiagnostics: An error or lint that doesn't give enough information about the problem at hand.Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleRelevant to the compiler team, which will review and decide on the PR/issue.