summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/tests
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-10-05 10:09:45 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-10-05 10:09:45 +0200
commit5cee7b02640f1223f478504ca136d1cc0806e5b9 (patch)
tree91a8477350bfe7c4c4be2f3bd48f7608da4b7ac7 /modules/gdscript/tests
parent5c26550b862da9c03dfda3f5994ccc480fcac44a (diff)
parented0b3c08e15ee6345ece4b135a5e99870a8fc79f (diff)
downloadredot-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.gd12
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/static_method_as_callable.out3
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