GDScript: Begin making constants deep, not shallow or flat

This commit is contained in:
Dmitrii Maganov
2023-01-08 05:41:06 +02:00
parent fcba87e696
commit 5e2ac1a31e
16 changed files with 82 additions and 36 deletions
@@ -0,0 +1,5 @@
const array: Array = [0]
func test():
var key: int = 0
array[key] = 0
@@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Cannot assign a new value to a constant.
@@ -0,0 +1,5 @@
const dictionary := {}
func test():
var key: int = 0
dictionary[key] = 0
@@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Cannot assign a new value to a constant.