Skip to content

Commit

Permalink
fix ambiguity reporting (#9648)
Browse files Browse the repository at this point in the history
# Objective

- I broke ambiguity reporting in one of my refactors.
`conflicts_to_string` should have been using the passed in parameter
rather than the one stored on self.
  • Loading branch information
hymm authored Aug 31, 2023
1 parent 3527288 commit c2b85f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/bevy_ecs/src/schedule/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@ mod tests {

let ambiguities: Vec<_> = schedule
.graph()
.conflicts_to_string(world.components())
.conflicts_to_string(schedule.graph().conflicting_systems(), world.components())
.collect();

let expected = &[
Expand Down
5 changes: 3 additions & 2 deletions crates/bevy_ecs/src/schedule/schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1553,7 +1553,7 @@ impl ScheduleGraph {
Consider adding `before`, `after`, or `ambiguous_with` relationships between these:\n",
);

for (name_a, name_b, conflicts) in self.conflicts_to_string(components) {
for (name_a, name_b, conflicts) in self.conflicts_to_string(ambiguities, components) {
writeln!(message, " -- {name_a} and {name_b}").unwrap();

if !conflicts.is_empty() {
Expand All @@ -1571,9 +1571,10 @@ impl ScheduleGraph {
/// convert conflics to human readable format
pub fn conflicts_to_string<'a>(
&'a self,
ambiguities: &'a [(NodeId, NodeId, Vec<ComponentId>)],
components: &'a Components,
) -> impl Iterator<Item = (String, String, Vec<&str>)> + 'a {
self.conflicting_systems
ambiguities
.iter()
.map(move |(system_a, system_b, conflicts)| {
let name_a = self.get_node_name(system_a);
Expand Down

0 comments on commit c2b85f9

Please sign in to comment.