diff --git a/godot-core/src/meta/args/object_arg.rs b/godot-core/src/meta/args/object_arg.rs index 304bd76db..741605a1e 100644 --- a/godot-core/src/meta/args/object_arg.rs +++ b/godot-core/src/meta/args/object_arg.rs @@ -81,7 +81,6 @@ where } } */ - impl AsObjectArg for &Gd where T: GodotClass + Bounds, diff --git a/itest/rust/src/object_tests/dyn_gd_test.rs b/itest/rust/src/object_tests/dyn_gd_test.rs index 34ee1c728..b88556703 100644 --- a/itest/rust/src/object_tests/dyn_gd_test.rs +++ b/itest/rust/src/object_tests/dyn_gd_test.rs @@ -153,6 +153,18 @@ fn dyn_gd_downgrade() { assert_eq!(gd.instance_id(), dyn_id); } +#[itest] +fn dyn_gd_pass_to_godot_api() { + let child = foreign::NodeHealth::new_alloc().into_dyn(); + + let mut parent = Node::new_alloc(); + parent.add_child(&child); + + assert_eq!(child.get_parent().as_ref(), Some(&parent)); + + parent.free(); +} + // ---------------------------------------------------------------------------------------------------------------------------------------------- // Example symbols