You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
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.
25 lines
536 B
GDScript
25 lines
536 B
GDScript
class_name ShadowedClass
|
|
extends ShadowingBase
|
|
|
|
var member: int = 0
|
|
|
|
var print_debug := 'print_debug'
|
|
@warning_ignore("shadowed_global_identifier")
|
|
var print := 'print'
|
|
|
|
@warning_ignore("unused_variable")
|
|
@warning_ignore("unused_local_constant")
|
|
func test():
|
|
var Array := 'Array'
|
|
var Node := 'Node'
|
|
var is_same := 'is_same'
|
|
var sqrt := 'sqrt'
|
|
var member := 'member'
|
|
var reference := 'reference'
|
|
var ShadowedClass := 'ShadowedClass'
|
|
var base_variable_member
|
|
const base_function_member = 1
|
|
var base_const_member
|
|
|
|
print('warn')
|