You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
GDScript: Fix accessing static function as Callable in static context
This commit is contained in:
@@ -1,12 +1,18 @@
|
||||
# GH-79521
|
||||
# GH-79521, GH-86032
|
||||
|
||||
class_name TestStaticMethodAsCallable
|
||||
|
||||
static func static_func() -> String:
|
||||
return "Test"
|
||||
|
||||
static func another_static_func():
|
||||
prints("another_static_func:", static_func.call(), static_func.is_valid())
|
||||
|
||||
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())
|
||||
@warning_ignore("static_called_on_instance")
|
||||
another_static_func()
|
||||
TestStaticMethodAsCallable.another_static_func()
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
GDTEST_OK
|
||||
Test true
|
||||
Test true
|
||||
another_static_func: Test true
|
||||
another_static_func: Test true
|
||||
|
||||
Reference in New Issue
Block a user