summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/tests/scripts/analyzer/errors
diff options
context:
space:
mode:
authorDanil Alexeev <danil@alexeev.xyz>2023-08-23 12:37:18 +0300
committerDanil Alexeev <danil@alexeev.xyz>2023-08-25 16:29:11 +0300
commit89429b0273a3358f4a0a283abf7efa7fcb4e5e4c (patch)
treefa92cea3947e222bedf4fa3ff69fb3d45921a269 /modules/gdscript/tests/scripts/analyzer/errors
parent6758a7f8c07d1f4c8ec4f052ded6d26402967ebe (diff)
downloadredot-engine-89429b0273a3358f4a0a283abf7efa7fcb4e5e4c.tar.gz
GDScript: Fix lambda resolution with cyclic references
Diffstat (limited to 'modules/gdscript/tests/scripts/analyzer/errors')
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/lambda_cyclic_ref_call_arg.gd5
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/lambda_cyclic_ref_call_arg.out2
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/lambda_cyclic_ref_param.gd5
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/lambda_cyclic_ref_param.out2
4 files changed, 14 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/lambda_cyclic_ref_call_arg.gd b/modules/gdscript/tests/scripts/analyzer/errors/lambda_cyclic_ref_call_arg.gd
new file mode 100644
index 0000000000..4b72fb9daa
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/errors/lambda_cyclic_ref_call_arg.gd
@@ -0,0 +1,5 @@
+var f = (func (_a): return 0).call(x)
+var x = f
+
+func test():
+ pass
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/lambda_cyclic_ref_call_arg.out b/modules/gdscript/tests/scripts/analyzer/errors/lambda_cyclic_ref_call_arg.out
new file mode 100644
index 0000000000..6bca25b330
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/errors/lambda_cyclic_ref_call_arg.out
@@ -0,0 +1,2 @@
+GDTEST_ANALYZER_ERROR
+Could not resolve member "f": Cyclic reference.
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/lambda_cyclic_ref_param.gd b/modules/gdscript/tests/scripts/analyzer/errors/lambda_cyclic_ref_param.gd
new file mode 100644
index 0000000000..115e8be50a
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/errors/lambda_cyclic_ref_param.gd
@@ -0,0 +1,5 @@
+var f = func (_a = x): return 0
+var x = f
+
+func test():
+ pass
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/lambda_cyclic_ref_param.out b/modules/gdscript/tests/scripts/analyzer/errors/lambda_cyclic_ref_param.out
new file mode 100644
index 0000000000..6bca25b330
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/errors/lambda_cyclic_ref_param.out
@@ -0,0 +1,2 @@
+GDTEST_ANALYZER_ERROR
+Could not resolve member "f": Cyclic reference.