diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-10-05 10:09:45 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-10-05 10:09:45 +0200 |
commit | 5cee7b02640f1223f478504ca136d1cc0806e5b9 (patch) | |
tree | 91a8477350bfe7c4c4be2f3bd48f7608da4b7ac7 /modules/gdscript/tests | |
parent | 5c26550b862da9c03dfda3f5994ccc480fcac44a (diff) | |
parent | ed0b3c08e15ee6345ece4b135a5e99870a8fc79f (diff) | |
download | redot-engine-5cee7b02640f1223f478504ca136d1cc0806e5b9.tar.gz |
Merge pull request #82767 from dalexeev/core-make-object-has-method-virtual
Core: Fix `Object::has_method()` for script static methods
Diffstat (limited to 'modules/gdscript/tests')
-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 |