summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/tests/scripts
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-01-18 16:35:14 +0100
committerRémi Verschelde <rverschelde@gmail.com>2024-01-18 16:35:14 +0100
commitbaf87e2717d2be4e2c8a43ff8d3e5f789125935f (patch)
tree5b5113d42b516b137993c64b08a937a9bfbf1f64 /modules/gdscript/tests/scripts
parent33f3511241b0ae90ee995879bf2c7eec33221327 (diff)
parentb4e08eb752cca0135208ed0729479e1d9c87773d (diff)
downloadredot-engine-baf87e2717d2be4e2c8a43ff8d3e5f789125935f.tar.gz
Merge pull request #87294 from vnen/allow-free-callable
Allow `free()` to be used as Callable
Diffstat (limited to 'modules/gdscript/tests/scripts')
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/free_is_callable.gd10
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/free_is_callable.out3
2 files changed, 13 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/runtime/features/free_is_callable.gd b/modules/gdscript/tests/scripts/runtime/features/free_is_callable.gd
new file mode 100644
index 0000000000..b9746a8207
--- /dev/null
+++ b/modules/gdscript/tests/scripts/runtime/features/free_is_callable.gd
@@ -0,0 +1,10 @@
+func test():
+ var node := Node.new()
+ var callable: Callable = node.free
+ callable.call()
+ print(node)
+
+ node = Node.new()
+ callable = node["free"]
+ callable.call()
+ print(node)
diff --git a/modules/gdscript/tests/scripts/runtime/features/free_is_callable.out b/modules/gdscript/tests/scripts/runtime/features/free_is_callable.out
new file mode 100644
index 0000000000..97bfc46d96
--- /dev/null
+++ b/modules/gdscript/tests/scripts/runtime/features/free_is_callable.out
@@ -0,0 +1,3 @@
+GDTEST_OK
+<Freed Object>
+<Freed Object>