GDScript: Fix non-static call is allowed in static var lambda body
This commit is contained in:
parent
f333e4acf5
commit
7f4721a941
11 changed files with 95 additions and 17 deletions
|
|
@ -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
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Cannot call non-static function "non_static_func()" from static function "static_func()".
|
||||
|
|
@ -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
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Cannot call non-static function "non_static_func()" from static function "static_func()".
|
||||
|
|
@ -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
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Cannot call non-static function "non_static_func()" from a static variable initializer.
|
||||
|
|
@ -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
|
||||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue