From 489dca774cc05dfa74d69b1068fd3fcd9705966c Mon Sep 17 00:00:00 2001 From: Jakob Hellermann Date: Mon, 26 May 2025 17:33:05 +0200 Subject: [PATCH] bevy_ecs: forward `type_id` in `InfallibleSystemWrapper` (#18931) similar to https://github.com/bevyengine/bevy/pull/12030 # Objective `bevy_mod_debugdump` uses the `SystemTypeSet::system_type` to look up constrains like `(system_1, system_2.after(system_1))`. For that it needs to find the type id in `schedule.graph().systems()` Now with systems being wrapped in an `InfallibleSystemWrapper` this association was no longer possible. ## Solution By forwarding the type id in `InfallibleSystemWrapper`, `bevy_mod_debugdump` can resolve the dependencies as before, and the wrapper is an unnoticable implementation detail. ## Testing - `cargo test -p bevy_ecs` I'm not sure what exactly could break otherwise. --- crates/bevy_ecs/src/system/schedule_system.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/bevy_ecs/src/system/schedule_system.rs b/crates/bevy_ecs/src/system/schedule_system.rs index 75fad2b7e9..b117f2c387 100644 --- a/crates/bevy_ecs/src/system/schedule_system.rs +++ b/crates/bevy_ecs/src/system/schedule_system.rs @@ -30,6 +30,10 @@ impl> System for InfallibleSystemWrapper { self.0.name() } + fn type_id(&self) -> core::any::TypeId { + self.0.type_id() + } + #[inline] fn component_access(&self) -> &Access { self.0.component_access()