summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2019-01-15 18:18:03 -0200
committerGeorge Marques <george@gmarqu.es>2019-01-15 18:18:03 -0200
commitb0c3a3f2da3f91a4a8fe41b98a814809fff7a9f1 (patch)
tree4ba311ea640690511d1338f09af2542358b370f2
parent573fab744736af10925490dec6387f24c26d5416 (diff)
GDScript: allow objects to be keys of dictionaries
The engine allows this already, so the parser should not fail in this case.
-rw-r--r--modules/gdscript/gdscript_parser.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index e51ce39bf3..4bfa83ee3b 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -6224,7 +6224,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
if (check_types && index_type.has_type) {
if (base_type.kind == DataType::BUILTIN) {
// Check if indexing is valid
- bool error = index_type.kind != DataType::BUILTIN;
+ bool error = index_type.kind != DataType::BUILTIN && base_type.builtin_type != Variant::DICTIONARY;
if (!error) {
switch (base_type.builtin_type) {
// Expect int or real as index