You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-10 13:00:37 +00:00
GDScript: Fix lambda captures in default argument values
This commit is contained in:
@@ -2926,6 +2926,9 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_lambda(ExpressionNode *p_p
|
|||||||
current_function = function;
|
current_function = function;
|
||||||
|
|
||||||
SuiteNode *body = alloc_node<SuiteNode>();
|
SuiteNode *body = alloc_node<SuiteNode>();
|
||||||
|
body->parent_function = current_function;
|
||||||
|
body->parent_block = current_suite;
|
||||||
|
|
||||||
SuiteNode *previous_suite = current_suite;
|
SuiteNode *previous_suite = current_suite;
|
||||||
current_suite = body;
|
current_suite = body;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# https://github.com/godotengine/godot/issues/56751
|
||||||
|
|
||||||
|
func test():
|
||||||
|
var x = "local"
|
||||||
|
var lambda = func(param = x):
|
||||||
|
print(param)
|
||||||
|
lambda.call()
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
GDTEST_OK
|
||||||
|
local
|
||||||
Reference in New Issue
Block a user