Merge pull request #110523 from StamLord/pattern-guard-warning-fix
Pattern guard warning fix
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user