summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/tests/scripts
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-06-18 16:27:42 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-06-18 16:27:42 +0200
commit4db1d09bf5a9302b5ea4651c8be6a1f1e7bf4ba8 (patch)
treeeedc0718cec644a481e0e424faa2924ed739b003 /modules/gdscript/tests/scripts
parent1ce2425c0efe2c8ce245d62adb3001040e44d0ab (diff)
parentb39b4010bd49b3b3c691850e5020f1b80b069654 (diff)
downloadredot-engine-4db1d09bf5a9302b5ea4651c8be6a1f1e7bf4ba8.tar.gz
Merge pull request #73657 from mashumafi/callable-ctor
Fix: Get constructor as Callable
Diffstat (limited to 'modules/gdscript/tests/scripts')
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/ctor_as_callable.gd10
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/ctor_as_callable.out3
2 files changed, 13 insertions, 0 deletions
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