summaryrefslogtreecommitdiff
path: root/modules/gdscript/tests/scripts/analyzer/features
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2021-10-15 10:40:50 -0300
committerGeorge Marques <george@gmarqu.es>2021-10-15 10:40:50 -0300
commit540821a264976b7295d2b32d9298992d00f1a17e (patch)
treebaf497fe87b058bbd45e69546b8f2a9ad19d4204 /modules/gdscript/tests/scripts/analyzer/features
parent342c1bf1e25348232af709edf90d16358b7b62c9 (diff)
GDScript: Fix inferred typed array marked as constant
Diffstat (limited to 'modules/gdscript/tests/scripts/analyzer/features')
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/typed_array_inferred_access_isnt_constant.gd6
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/typed_array_inferred_access_isnt_constant.out2
2 files changed, 8 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/analyzer/features/typed_array_inferred_access_isnt_constant.gd b/modules/gdscript/tests/scripts/analyzer/features/typed_array_inferred_access_isnt_constant.gd
new file mode 100644
index 0000000000..55c40cb971
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/features/typed_array_inferred_access_isnt_constant.gd
@@ -0,0 +1,6 @@
+# https://github.com/godotengine/godot/issues/53640
+
+func test():
+ var arr := [0]
+ arr[0] = 1
+ print(arr[0])
diff --git a/modules/gdscript/tests/scripts/analyzer/features/typed_array_inferred_access_isnt_constant.out b/modules/gdscript/tests/scripts/analyzer/features/typed_array_inferred_access_isnt_constant.out
new file mode 100644
index 0000000000..a7f1357bb2
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/features/typed_array_inferred_access_isnt_constant.out
@@ -0,0 +1,2 @@
+GDTEST_OK
+1