mirror of
https://github.com/godotengine/godot.git
synced 2025-10-23 09:53:25 +00:00
GDScript: Suppress unused constant warning with underscore
The warning message mentions that local constants prefixed with `_` does not generate the warning. This commit actually implements this warning suppression.
This commit is contained in:
parent
658e97c93a
commit
a3b3a20ac0
5 changed files with 10 additions and 53 deletions
|
@ -1985,7 +1985,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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue