1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Merge pull request #90794 from vnen/gdscript-no-unused-constant-warning-with-underscore

GDScript: Suppress unused constant warning with underscore
This commit is contained in:
Rémi Verschelde
2024-04-18 15:17:13 +02:00
5 changed files with 10 additions and 53 deletions

View File

@@ -1997,7 +1997,7 @@ void GDScriptAnalyzer::resolve_constant(GDScriptParser::ConstantNode *p_constant
#ifdef DEBUG_ENABLED
if (p_is_local) {
if (p_constant->usages == 0) {
if (p_constant->usages == 0 && !String(p_constant->identifier->name).begins_with("_")) {
parser->push_warning(p_constant, GDScriptWarning::UNUSED_LOCAL_CONSTANT, p_constant->identifier->name);
}
}