summaryrefslogtreecommitdiff
path: root/modules/gdscript
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2020-01-08 19:28:07 -0300
committerGeorge Marques <george@gmarqu.es>2020-01-08 19:28:07 -0300
commite7b7dc57fc8ecab198695d9bf6a4d694fb5a72a8 (patch)
treef9be02a8f94dcf409c6fe7496ad78c3481bc660d /modules/gdscript
parentb9a553f99de109427fc8ac62f7f3de0ec708a1b8 (diff)
GDScript: set assign operation on local var made by match
This is needed in a all local variables with assigment to properly set the typed operation. Fix #34928
Diffstat (limited to 'modules/gdscript')
-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 0a1eda37ca..fc35678e65 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -2689,6 +2689,7 @@ void GDScriptParser::_transform_match_statment(MatchNode *p_match_statement) {
op->op = OperatorNode::OP_ASSIGN;
op->arguments.push_back(id2);
op->arguments.push_back(local_var->assign);
+ local_var->assign_op = op;
branch->body->statements.push_front(op);
branch->body->statements.push_front(local_var);
@@ -2866,7 +2867,6 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) {
assigned = _get_default_value_for_type(lv->datatype, var_line);
}
- lv->assign = assigned;
//must be added later, to avoid self-referencing.
p_block->variables.insert(n, lv);