godot-gdscript-toolkit
godot-gdscript-toolkit copied to clipboard
gdlint: false positive on duplicated-load when preloading scripts inside inner classes
trafficstars
In gdscript 3.5 you must to preload a class inside an inner class to get access to the class as the inner class has no access to the outer class's constants.
Unfortunately this needs a # gdlint: ignore=duplicated-load directive each time since gdlint doesn't understand that this is not actually a duplicated-load
# gdlint: ignore=duplicated-load
const LoadedClass = preload("res://LoadedClass.gd")
class InnerClass:
extends Reference
# gdlint: ignore=duplicated-load
const LoadedClass = preload("res://LoadedClass.gd")
var _value: LoadedClass
func _init(value: LoadedClass):
_value = value
var value := InnerClass.new(LoadedClass.new())
Yes, that would make sense to make the check per-class