summaryrefslogtreecommitdiff
path: root/modules/gdscript/tests/scripts/parser
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2022-05-23 21:38:31 -0300
committerGeorge Marques <george@gmarqu.es>2022-05-23 21:38:31 -0300
commit1b76a9d70515cc98d9772c72daadbf2634aa788f (patch)
tree78ddc123964fe568d3b1be61985bdbf8e43c6925 /modules/gdscript/tests/scripts/parser
parent969f1980d29cfc48c45a1bebdc98935b641dda50 (diff)
GDScript: Fix lambda captures in default argument values
Diffstat (limited to 'modules/gdscript/tests/scripts/parser')
-rw-r--r--modules/gdscript/tests/scripts/parser/features/lambda_default_parameter_capture.gd7
-rw-r--r--modules/gdscript/tests/scripts/parser/features/lambda_default_parameter_capture.out2
2 files changed, 9 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/parser/features/lambda_default_parameter_capture.gd b/modules/gdscript/tests/scripts/parser/features/lambda_default_parameter_capture.gd
new file mode 100644
index 0000000000..2140b6923e
--- /dev/null
+++ b/modules/gdscript/tests/scripts/parser/features/lambda_default_parameter_capture.gd
@@ -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()
diff --git a/modules/gdscript/tests/scripts/parser/features/lambda_default_parameter_capture.out b/modules/gdscript/tests/scripts/parser/features/lambda_default_parameter_capture.out
new file mode 100644
index 0000000000..ce3241b94d
--- /dev/null
+++ b/modules/gdscript/tests/scripts/parser/features/lambda_default_parameter_capture.out
@@ -0,0 +1,2 @@
+GDTEST_OK
+local