You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-14 13:41:12 +00:00
Fix analyzer pushing SHADOWED_VARIABLE warning for members shadowed in subclasses
This fixes a bug in the analyzer where it did not push the SHADOWED_VARIABLE_BASE_CLASS warning for members shadowed by variable in subclass. It does this by comparing the class which contains the shadowed member with the class containing the variable, and pushing SHADOWED_VARIABLE only if the classes are the same. Additionally, SHADOWED_VARIABLE_BASE_CLASS can take an extra symbol which helps to specify the line for non native base class.
This commit is contained in:
@@ -6,4 +6,4 @@ GDTEST_OK
|
||||
>> WARNING
|
||||
>> Line: 8
|
||||
>> SHADOWED_VARIABLE
|
||||
>> The local constant "TEST" is shadowing an already-declared constant at line 2.
|
||||
>> The local constant "TEST" is shadowing an already-declared constant at line 2 in the current class.
|
||||
|
||||
@@ -6,4 +6,4 @@ GDTEST_OK
|
||||
>> WARNING
|
||||
>> Line: 8
|
||||
>> SHADOWED_VARIABLE
|
||||
>> The local variable "foo" is shadowing an already-declared variable at line 1.
|
||||
>> The local variable "foo" is shadowing an already-declared variable at line 1 in the current class.
|
||||
|
||||
@@ -6,4 +6,4 @@ GDTEST_OK
|
||||
>> WARNING
|
||||
>> Line: 2
|
||||
>> SHADOWED_VARIABLE
|
||||
>> The local variable "test" is shadowing an already-declared function at line 1.
|
||||
>> The local variable "test" is shadowing an already-declared function at line 1 in the current class.
|
||||
|
||||
Reference in New Issue
Block a user