Skip to content

Commit

Permalink
Add test and fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
SkiFire13 committed Jul 16, 2024
1 parent 609f4aa commit 9d814d4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion crates/bevy_ecs/src/query/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ macro_rules! impl_or_query_filter {
$filter::update_component_access($filter, &mut intermediate);
_new_access.append_or(&intermediate);
// Also extend the accesses required to compute the filter. This is required because
// otherwise a `Query<(), Changed<Foo>>` won't conflict with `Query<&mut Foo>`.
// otherwise a `Query<(), Or<(Changed<Foo>,)>` won't conflict with `Query<&mut Foo>`.
_new_access.extend_access(&intermediate);
)*

Expand Down
9 changes: 9 additions & 0 deletions crates/bevy_ecs/src/system/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,15 @@ mod tests {
run_system(&mut world, sys);
}

#[test]
#[should_panic]
fn changed_trackers_conflict() {
fn sys(_: Query<&mut A>, _: Query<(), Or<(Changed<A>,)>>) {}

let mut world = World::default();
run_system(&mut world, sys);
}

#[test]
fn query_set_system() {
fn sys(mut _set: ParamSet<(Query<&mut A>, Query<&A>)>) {}
Expand Down

0 comments on commit 9d814d4

Please sign in to comment.