From b39b4010bd49b3b3c691850e5020f1b80b069654 Mon Sep 17 00:00:00 2001 From: mashumafi Date: Mon, 20 Feb 2023 21:55:35 -0500 Subject: Fix: Get constructor as Callable --- .../tests/scripts/runtime/features/ctor_as_callable.gd | 10 ++++++++++ .../tests/scripts/runtime/features/ctor_as_callable.out | 3 +++ 2 files changed, 13 insertions(+) create mode 100644 modules/gdscript/tests/scripts/runtime/features/ctor_as_callable.gd create mode 100644 modules/gdscript/tests/scripts/runtime/features/ctor_as_callable.out (limited to 'modules/gdscript/tests/scripts') diff --git a/modules/gdscript/tests/scripts/runtime/features/ctor_as_callable.gd b/modules/gdscript/tests/scripts/runtime/features/ctor_as_callable.gd new file mode 100644 index 0000000000..515efbc9ce --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/ctor_as_callable.gd @@ -0,0 +1,10 @@ +# https://github.com/godotengine/godot/issues/70319 + +class InnerClass: + pass + +func test(): + var inner_ctor : Callable = InnerClass.new + print(inner_ctor) + var native_ctor : Callable = Node.new + print(native_ctor) diff --git a/modules/gdscript/tests/scripts/runtime/features/ctor_as_callable.out b/modules/gdscript/tests/scripts/runtime/features/ctor_as_callable.out new file mode 100644 index 0000000000..527e3e8f84 --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/ctor_as_callable.out @@ -0,0 +1,3 @@ +GDTEST_OK +GDScript::new +GDScriptNativeClass::new -- cgit v1.2.3