GDScript: Fix non-static call is allowed in static var lambda body
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
# GH-83468
|
||||
|
||||
func non_static_func():
|
||||
pass
|
||||
|
||||
static func static_func():
|
||||
var f := func ():
|
||||
var g := func ():
|
||||
non_static_func()
|
||||
g.call()
|
||||
f.call()
|
||||
|
||||
func test():
|
||||
pass
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
Cannot call non-static function "non_static_func()" from static function "static_func()".
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
# GH-83468
|
||||
|
||||
func non_static_func():
|
||||
pass
|
||||
|
||||
static func static_func(
|
||||
f := func ():
|
||||
var g := func ():
|
||||
non_static_func()
|
||||
g.call()
|
||||
):
|
||||
f.call()
|
||||
|
||||
func test():
|
||||
pass
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
Cannot call non-static function "non_static_func()" from static function "static_func()".
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
# GH-83468
|
||||
|
||||
func non_static_func():
|
||||
pass
|
||||
|
||||
static var static_var = func ():
|
||||
var f := func ():
|
||||
var g := func ():
|
||||
non_static_func()
|
||||
g.call()
|
||||
f.call()
|
||||
|
||||
func test():
|
||||
pass
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
Cannot call non-static function "non_static_func()" from a static variable initializer.
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
# GH-83468
|
||||
|
||||
func non_static_func():
|
||||
pass
|
||||
|
||||
static var static_var:
|
||||
set(_value):
|
||||
var f := func ():
|
||||
var g := func ():
|
||||
non_static_func()
|
||||
g.call()
|
||||
f.call()
|
||||
|
||||
func test():
|
||||
pass
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
Cannot call non-static function "non_static_func()" from static function "@static_var_setter()".
|
||||
@@ -1,2 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
Cannot call non-static function "non_static()" for static variable initializer.
|
||||
Cannot call non-static function "non_static()" from a static variable initializer.
|
||||
|
||||
Reference in New Issue
Block a user