summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/tests/scripts/analyzer/warnings
diff options
context:
space:
mode:
authorjpcerrone <jpcerronex@gmail.com>2023-04-03 10:57:41 -0300
committerjpcerrone <jpcerronex@gmail.com>2023-07-24 17:22:12 -0300
commit13c73500ab9b09c5b946968716bef03a814fb65d (patch)
tree4decab07542187b30962d49596e6856ca05ba238 /modules/gdscript/tests/scripts/analyzer/warnings
parent91258e52be59d1c1c93b0b798f2401dbbb15a1d0 (diff)
downloadredot-engine-13c73500ab9b09c5b946968716bef03a814fb65d.tar.gz
Fix for not being able to ignore shadowing warnings on class scope
Diffstat (limited to 'modules/gdscript/tests/scripts/analyzer/warnings')
-rw-r--r--modules/gdscript/tests/scripts/analyzer/warnings/shadowning.gd4
-rw-r--r--modules/gdscript/tests/scripts/analyzer/warnings/shadowning.out16
2 files changed, 14 insertions, 6 deletions
diff --git a/modules/gdscript/tests/scripts/analyzer/warnings/shadowning.gd b/modules/gdscript/tests/scripts/analyzer/warnings/shadowning.gd
index 61945c9c8f..29239a19da 100644
--- a/modules/gdscript/tests/scripts/analyzer/warnings/shadowning.gd
+++ b/modules/gdscript/tests/scripts/analyzer/warnings/shadowning.gd
@@ -1,5 +1,9 @@
var member: int = 0
+var print_debug := 'print_debug'
+@warning_ignore("shadowed_global_identifier")
+var print := 'print'
+
@warning_ignore("unused_variable")
func test():
var Array := 'Array'
diff --git a/modules/gdscript/tests/scripts/analyzer/warnings/shadowning.out b/modules/gdscript/tests/scripts/analyzer/warnings/shadowning.out
index 8467697a96..accc791d8a 100644
--- a/modules/gdscript/tests/scripts/analyzer/warnings/shadowning.out
+++ b/modules/gdscript/tests/scripts/analyzer/warnings/shadowning.out
@@ -1,26 +1,30 @@
GDTEST_OK
>> WARNING
->> Line: 5
+>> Line: 3
+>> SHADOWED_GLOBAL_IDENTIFIER
+>> The variable "print_debug" has the same name as a built-in function.
+>> WARNING
+>> Line: 9
>> SHADOWED_GLOBAL_IDENTIFIER
>> The variable "Array" has the same name as a built-in type.
>> WARNING
->> Line: 6
+>> Line: 10
>> SHADOWED_GLOBAL_IDENTIFIER
>> The variable "Node" has the same name as a global class.
>> WARNING
->> Line: 7
+>> Line: 11
>> SHADOWED_GLOBAL_IDENTIFIER
>> The variable "is_same" has the same name as a built-in function.
>> WARNING
->> Line: 8
+>> Line: 12
>> SHADOWED_GLOBAL_IDENTIFIER
>> The variable "sqrt" has the same name as a built-in function.
>> WARNING
->> Line: 9
+>> Line: 13
>> SHADOWED_VARIABLE
>> The local variable "member" is shadowing an already-declared variable at line 1.
>> WARNING
->> Line: 10
+>> Line: 14
>> SHADOWED_VARIABLE_BASE_CLASS
>> The local variable "reference" is shadowing an already-declared method at the base class "RefCounted".
warn