Detect parameter mismatch for signals
Assume some code like this:
signal my_signal(foo:String)
func _ready():
my_signal.connect(_on_my_signal)
func _on_my_signal():
pass
I have now connected the _on_my_signal
method to the my_signal
signal. However the signal sends 1 parameter while my method takes no parameters. This is valid at compile time but will cause an error at runtime because the parameter count does not match. It would be nice if the plugin could show a warning for this.
Note that there are also ways to work around this with bind/unbind...
func _ready():
my_signal.connect(_on_my_signal.unbind(1)) # now it would be compatible
I'm not sure if this can be properly detected if the parameter to unbind is no literal but it would still be really nice to have for cases when it can be 100% statically deduced that the call will fail.