Merge pull request #110523 from StamLord/pattern-guard-warning-fix

Pattern guard warning fix
This commit is contained in:
Thaddeus Crews
2026-01-29 12:11:15 -06:00
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -2053,7 +2053,7 @@ void GDScriptAnalyzer::decide_suite_type(GDScriptParser::Node *p_suite, GDScript
}
}
void GDScriptAnalyzer::resolve_suite(GDScriptParser::SuiteNode *p_suite) {
void GDScriptAnalyzer::resolve_suite(GDScriptParser::SuiteNode *p_suite, bool p_is_root) {
for (int i = 0; i < p_suite->statements.size(); i++) {
GDScriptParser::Node *stmt = p_suite->statements[i];
// Apply annotations.
@@ -2062,7 +2062,7 @@ void GDScriptAnalyzer::resolve_suite(GDScriptParser::SuiteNode *p_suite) {
E->apply(parser, stmt, nullptr); // TODO: Provide `p_class`.
}
resolve_node(stmt);
resolve_node(stmt, p_is_root);
resolve_pending_lambda_bodies();
decide_suite_type(p_suite, stmt);
}
@@ -2424,7 +2424,7 @@ void GDScriptAnalyzer::resolve_match_branch(GDScriptParser::MatchBranchNode *p_m
}
if (p_match_branch->guard_body) {
resolve_suite(p_match_branch->guard_body);
resolve_suite(p_match_branch->guard_body, false);
}
resolve_suite(p_match_branch->block);
+1 -1
View File
@@ -81,7 +81,7 @@ class GDScriptAnalyzer {
void resolve_function_signature(GDScriptParser::FunctionNode *p_function, const GDScriptParser::Node *p_source = nullptr, bool p_is_lambda = false);
void resolve_function_body(GDScriptParser::FunctionNode *p_function, bool p_is_lambda = false);
void resolve_node(GDScriptParser::Node *p_node, bool p_is_root = true);
void resolve_suite(GDScriptParser::SuiteNode *p_suite);
void resolve_suite(GDScriptParser::SuiteNode *p_suite, bool p_is_root = true);
void resolve_assignable(GDScriptParser::AssignableNode *p_assignable, const char *p_kind);
void resolve_variable(GDScriptParser::VariableNode *p_variable, bool p_is_local);
void resolve_constant(GDScriptParser::ConstantNode *p_constant, bool p_is_local);