summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/tests/scripts/runtime
diff options
context:
space:
mode:
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'.