mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
Fix 'unreachable-code' false-positive, fixes #55154
This commit is contained in:
parent
ed02b8af59
commit
86c0e38e8f
3 changed files with 19 additions and 5 deletions
|
@ -1813,7 +1813,6 @@ GDScriptParser::MatchNode *GDScriptParser::parse_match() {
|
|||
#ifdef DEBUG_ENABLED
|
||||
bool all_have_return = true;
|
||||
bool have_wildcard = false;
|
||||
bool wildcard_has_return = false;
|
||||
bool have_wildcard_without_continue = false;
|
||||
#endif
|
||||
|
||||
|
@ -1831,9 +1830,6 @@ GDScriptParser::MatchNode *GDScriptParser::parse_match() {
|
|||
|
||||
if (branch->has_wildcard) {
|
||||
have_wildcard = true;
|
||||
if (branch->block->has_return) {
|
||||
wildcard_has_return = true;
|
||||
}
|
||||
if (!branch->block->has_continue) {
|
||||
have_wildcard_without_continue = true;
|
||||
}
|
||||
|
@ -1848,7 +1844,7 @@ GDScriptParser::MatchNode *GDScriptParser::parse_match() {
|
|||
consume(GDScriptTokenizer::Token::DEDENT, R"(Expected an indented block after "match" statement.)");
|
||||
|
||||
#ifdef DEBUG_ENABLED
|
||||
if (wildcard_has_return || (all_have_return && have_wildcard)) {
|
||||
if (all_have_return && have_wildcard) {
|
||||
current_suite->has_return = true;
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue