diff options
author | Danil Alexeev <danil@alexeev.xyz> | 2023-10-04 07:54:03 +0300 |
---|---|---|
committer | Danil Alexeev <danil@alexeev.xyz> | 2023-10-04 19:44:32 +0300 |
commit | ed0b3c08e15ee6345ece4b135a5e99870a8fc79f (patch) | |
tree | ac8fe0ff0c7dcb8d10e660c631946c8a3f58a6ee /modules/gdscript/tests/scripts | |
parent | bfd78bb917887cfc1fd842ba23570394cad8bedb (diff) | |
download | redot-engine-ed0b3c08e15ee6345ece4b135a5e99870a8fc79f.tar.gz |
Core: Fix `Object::has_method()` for script static methods
Diffstat (limited to 'modules/gdscript/tests/scripts')
-rw-r--r-- | modules/gdscript/tests/scripts/runtime/features/static_method_as_callable.gd | 12 | ||||
-rw-r--r-- | modules/gdscript/tests/scripts/runtime/features/static_method_as_callable.out | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/runtime/features/static_method_as_callable.gd b/modules/gdscript/tests/scripts/runtime/features/static_method_as_callable.gd new file mode 100644 index 0000000000..f6aa58737f --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/static_method_as_callable.gd @@ -0,0 +1,12 @@ +# GH-79521 + +class_name TestStaticMethodAsCallable + +static func static_func() -> String: + return "Test" + +func test(): + var a: Callable = TestStaticMethodAsCallable.static_func + var b: Callable = static_func + prints(a.call(), a.is_valid()) + prints(b.call(), b.is_valid()) diff --git a/modules/gdscript/tests/scripts/runtime/features/static_method_as_callable.out b/modules/gdscript/tests/scripts/runtime/features/static_method_as_callable.out new file mode 100644 index 0000000000..e6d461b8f9 --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/static_method_as_callable.out @@ -0,0 +1,3 @@ +GDTEST_OK +Test true +Test true |