diff options
author | Nathan Franke <me@nathan.sh> | 2022-06-03 12:42:03 -0500 |
---|---|---|
committer | Nathan Franke <me@nathan.sh> | 2022-06-03 13:28:33 -0500 |
commit | 3d61246bc4bce185dcdfc156945085456fbad402 (patch) | |
tree | bd3af93e2b73e66533562581fd705bfa65ea3b43 /modules/gdscript/gdscript_analyzer.cpp | |
parent | c0bf18e92398c0d5a9cc3a9c51073ddcc5224b65 (diff) |
use correct error for unused bind match, suppress with underscore
Diffstat (limited to 'modules/gdscript/gdscript_analyzer.cpp')
-rw-r--r-- | modules/gdscript/gdscript_analyzer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index 9fa518ca0b..a070d319f3 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -1657,8 +1657,8 @@ void GDScriptAnalyzer::resolve_match_pattern(GDScriptParser::PatternNode *p_matc p_match_pattern->bind->set_datatype(result); #ifdef DEBUG_ENABLED is_shadowing(p_match_pattern->bind, "pattern bind"); - if (p_match_pattern->bind->usages == 0) { - parser->push_warning(p_match_pattern->bind, GDScriptWarning::UNASSIGNED_VARIABLE, p_match_pattern->bind->name); + if (p_match_pattern->bind->usages == 0 && !String(p_match_pattern->bind->name).begins_with("_")) { + parser->push_warning(p_match_pattern->bind, GDScriptWarning::UNUSED_VARIABLE, p_match_pattern->bind->name); } #endif break; |