summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-04-21 23:04:16 +0200
committerGitHub <noreply@github.com>2020-04-21 23:04:16 +0200
commit9716204555efc07e7127536605b0659ceb0523b0 (patch)
tree2d135de74ef2393d7ac85134a859bd9b181e4fcb
parent9a283f7e71ed5ab92fce5bb1f1ef9dbebe0f0140 (diff)
parent44281f233dd0f3cff13a0c14320de943ee4719ea (diff)
Merge pull request #37712 from stoofin/pattern-bind-warning
Fix unassigned variable warnings for match bindings
-rw-r--r--modules/gdscript/gdscript_parser.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index 7e8d2b0436..f1e20b1cfc 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -2683,6 +2683,7 @@ void GDScriptParser::_transform_match_statment(MatchNode *p_match_statement) {
LocalVarNode *local_var = branch->body->variables[e->key()];
local_var->assign = e->value();
local_var->set_datatype(local_var->assign->get_datatype());
+ local_var->assignments++;
IdentifierNode *id2 = alloc_node<IdentifierNode>();
id2->name = local_var->name;