1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

GDScript: Do not allow standalone lambdas

They cannot be accessed in this case, so an error is shown to avoid
misleading the uses, especially in case of named lambdas.
This commit is contained in:
George Marques
2022-05-23 12:25:03 -03:00
parent a76db34592
commit 0a28b4cd94
3 changed files with 9 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
func test():
func standalone():
print("can't be accessed")

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Standalone lambdas cannot be accessed. Consider assigning it to a variable.