summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/tests/scripts/runtime
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-05-01 09:54:48 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-05-01 09:54:48 +0200
commit273a643145bb1255507d3a721f8e0a82d07516ab (patch)
tree2325609fa42dc3d7888183e89385613d34c4fd9e /modules/gdscript/tests/scripts/runtime
parent85062e37efbba65b7bb7d191a53e5207df942b86 (diff)
parentec29c3e784abdf891abd38f42444216e3d2a0fb7 (diff)
downloadredot-engine-273a643145bb1255507d3a721f8e0a82d07516ab.tar.gz
Merge pull request #89647 from AThousandShips/read_only_dict
[Core] Fix property access on read-only `Dictionary`
Diffstat (limited to 'modules/gdscript/tests/scripts/runtime')
-rw-r--r--modules/gdscript/tests/scripts/runtime/errors/read_only_dictionary.gd4
-rw-r--r--modules/gdscript/tests/scripts/runtime/errors/read_only_dictionary.out6
2 files changed, 10 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/runtime/errors/read_only_dictionary.gd b/modules/gdscript/tests/scripts/runtime/errors/read_only_dictionary.gd
new file mode 100644
index 0000000000..2f31ecc52f
--- /dev/null
+++ b/modules/gdscript/tests/scripts/runtime/errors/read_only_dictionary.gd
@@ -0,0 +1,4 @@
+func test():
+ var dictionary := { "a": 0 }
+ dictionary.make_read_only()
+ dictionary.a = 1
diff --git a/modules/gdscript/tests/scripts/runtime/errors/read_only_dictionary.out b/modules/gdscript/tests/scripts/runtime/errors/read_only_dictionary.out
new file mode 100644
index 0000000000..da7ce58d73
--- /dev/null
+++ b/modules/gdscript/tests/scripts/runtime/errors/read_only_dictionary.out
@@ -0,0 +1,6 @@
+GDTEST_RUNTIME_ERROR
+>> SCRIPT ERROR
+>> on function: test()
+>> runtime/errors/read_only_dictionary.gd
+>> 4
+>> Invalid assignment of property or key 'a' with value of type 'int' on a base object of type 'Dictionary'.