From 172bf5b905c6ab82e96f5ef8a14ff3bc9193f7ad Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 23 Jun 2026 00:19:05 +0200 Subject: feat(engine): add type reflection fn for casting to dyn Any --- engine-macros/src/reflection/enum_impl.rs | 3 ++- engine-macros/src/reflection/struct_impl.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'engine-macros/src') diff --git a/engine-macros/src/reflection/enum_impl.rs b/engine-macros/src/reflection/enum_impl.rs index 9d53d8e..41aa673 100644 --- a/engine-macros/src/reflection/enum_impl.rs +++ b/engine-macros/src/reflection/enum_impl.rs @@ -165,7 +165,8 @@ fn generate_impls( tagged_union: #tagged_union, get_default_value: || { #get_default_value_fn - } + }, + cast_dyn_any: |ptr| ptr.cast::() } ) }; diff --git a/engine-macros/src/reflection/struct_impl.rs b/engine-macros/src/reflection/struct_impl.rs index 58046fe..4fbf88b 100644 --- a/engine-macros/src/reflection/struct_impl.rs +++ b/engine-macros/src/reflection/struct_impl.rs @@ -88,7 +88,8 @@ fn gen_impl( ], get_default_value: || { #get_default_value_fn - } + }, + cast_dyn_any: |ptr| ptr.cast::() } ) }; -- cgit v1.2.3-18-g5258