diff options
author | Danil Alexeev <danil@alexeev.xyz> | 2024-01-05 13:56:42 +0300 |
---|---|---|
committer | Danil Alexeev <danil@alexeev.xyz> | 2024-01-05 21:16:53 +0300 |
commit | b31acb0cd543f016c17252c575c4dee7dd5a409d (patch) | |
tree | e2dff26e0ace675863bc4b8282302a288c092009 /modules/gdscript/tests/scripts/runtime/features | |
parent | 179dfdc8d78b5bd5377dd115af026df58308bdaf (diff) | |
download | redot-engine-b31acb0cd543f016c17252c575c4dee7dd5a409d.tar.gz |
GDScript: Allow utility functions to be used as `Callable`
Diffstat (limited to 'modules/gdscript/tests/scripts/runtime/features')
-rw-r--r-- | modules/gdscript/tests/scripts/runtime/features/utility_func_as_callable.gd | 10 | ||||
-rw-r--r-- | modules/gdscript/tests/scripts/runtime/features/utility_func_as_callable.out | 7 |
2 files changed, 17 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/runtime/features/utility_func_as_callable.gd b/modules/gdscript/tests/scripts/runtime/features/utility_func_as_callable.gd new file mode 100644 index 0000000000..11f064bb83 --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/utility_func_as_callable.gd @@ -0,0 +1,10 @@ +func test(): + print(print) + print(len) + + prints.callv([1, 2, 3]) + print(mini.call(1, 2)) + print(len.bind("abc").call()) + + const ABSF = absf + print(ABSF.call(-1.2)) diff --git a/modules/gdscript/tests/scripts/runtime/features/utility_func_as_callable.out b/modules/gdscript/tests/scripts/runtime/features/utility_func_as_callable.out new file mode 100644 index 0000000000..91549b9345 --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/utility_func_as_callable.out @@ -0,0 +1,7 @@ +GDTEST_OK +@GlobalScope::print (Callable) +@GDScript::len (Callable) +1 2 3 +1 +3 +1.2 |