1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +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:
George Marques
2024-04-17 09:40:58 -03:00
parent 658e97c93a
commit a3b3a20ac0
5 changed files with 10 additions and 53 deletions

View File

@@ -0,0 +1,4 @@
func test():
const UNUSED = "not used"
const _UNUSED = "not used, but no warning since the constant name starts with an underscore"

View File

@@ -0,0 +1,5 @@
GDTEST_OK
>> WARNING
>> Line: 2
>> UNUSED_LOCAL_CONSTANT
>> The local constant "UNUSED" is declared but never used in the block. If this is intended, prefix it with an underscore: "_UNUSED".