From 22053ed75f6a74e7ead20b4f5638a44920809335 Mon Sep 17 00:00:00 2001 From: Thakee Nathees Date: Sun, 5 Apr 2020 08:35:24 +0530 Subject: [PATCH] GDScript class var type resolve bug fixed Fix: #37545 (cherry picked from commit e67eb5ca367edd363ec00fe86dfe98b25294076a) --- modules/gdscript/gdscript_parser.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 4e8e301239a..798ff5cf0d7 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -2729,6 +2729,7 @@ void GDScriptParser::_transform_match_statment(MatchNode *p_match_statement) { IdentifierNode *id2 = alloc_node(); id2->name = local_var->name; + id2->datatype = local_var->datatype; id2->declared_block = branch->body; id2->set_datatype(local_var->assign->get_datatype()); @@ -4964,6 +4965,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) { IdentifierNode *id = alloc_node(); id->name = member.identifier; + id->datatype = member.data_type; OperatorNode *op = alloc_node(); op->op = OperatorNode::OP_INIT_ASSIGN; @@ -5006,6 +5008,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) { IdentifierNode *id = alloc_node(); id->name = member.identifier; + id->datatype = member.data_type; OperatorNode *op = alloc_node(); op->op = OperatorNode::OP_INIT_ASSIGN; @@ -6649,6 +6652,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) { IdentifierNode *id = alloc_node(); id->name = cn->value.operator StringName(); + id->datatype = cn->datatype; op->op = OperatorNode::OP_INDEX_NAMED; op->arguments.write[1] = id;