GDScript class var type resolve bug fixed

Fix: #37545
(cherry picked from commit e67eb5ca36)
This commit is contained in:
Thakee Nathees 2020-04-05 08:35:24 +05:30 committed by Rémi Verschelde
parent 6b0cfc87af
commit 22053ed75f
1 changed files with 4 additions and 0 deletions

View File

@ -2729,6 +2729,7 @@ void GDScriptParser::_transform_match_statment(MatchNode *p_match_statement) {
IdentifierNode *id2 = alloc_node<IdentifierNode>(); IdentifierNode *id2 = alloc_node<IdentifierNode>();
id2->name = local_var->name; id2->name = local_var->name;
id2->datatype = local_var->datatype;
id2->declared_block = branch->body; id2->declared_block = branch->body;
id2->set_datatype(local_var->assign->get_datatype()); id2->set_datatype(local_var->assign->get_datatype());
@ -4964,6 +4965,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
IdentifierNode *id = alloc_node<IdentifierNode>(); IdentifierNode *id = alloc_node<IdentifierNode>();
id->name = member.identifier; id->name = member.identifier;
id->datatype = member.data_type;
OperatorNode *op = alloc_node<OperatorNode>(); OperatorNode *op = alloc_node<OperatorNode>();
op->op = OperatorNode::OP_INIT_ASSIGN; op->op = OperatorNode::OP_INIT_ASSIGN;
@ -5006,6 +5008,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
IdentifierNode *id = alloc_node<IdentifierNode>(); IdentifierNode *id = alloc_node<IdentifierNode>();
id->name = member.identifier; id->name = member.identifier;
id->datatype = member.data_type;
OperatorNode *op = alloc_node<OperatorNode>(); OperatorNode *op = alloc_node<OperatorNode>();
op->op = OperatorNode::OP_INIT_ASSIGN; op->op = OperatorNode::OP_INIT_ASSIGN;
@ -6649,6 +6652,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
IdentifierNode *id = alloc_node<IdentifierNode>(); IdentifierNode *id = alloc_node<IdentifierNode>();
id->name = cn->value.operator StringName(); id->name = cn->value.operator StringName();
id->datatype = cn->datatype;
op->op = OperatorNode::OP_INDEX_NAMED; op->op = OperatorNode::OP_INDEX_NAMED;
op->arguments.write[1] = id; op->arguments.write[1] = id;