Godot version:
3.1 beta 4
OS/device including version:
Windows 10
Issue description:
You can't add typing to signals. This was probably a missed thing when implementing typing.
This is not a bug, it was deliberately not implemented. Typing for signals require much more thought than regular typing for variables and methods.
I thought there was an issue about this already, but couldn't find in a quick search.
are you gonna target it for 3.2?
Since this has come up again, let me clarify that the reason that I didn't add typing for signals is that it's difficult to enforce in the compiler. Since signals use strings and variables to connect and emit, it's harder to track the origin of the signal and connected function.
Once we add first-class functions we'll be able to connect directly using a function reference, then it'll be easier to track and enforce the typing rules in signals.
please add this there is no point in staticly typing if we can use it for everything
I would also like to see this supported for custom types for 4.0
Most helpful comment
Since this has come up again, let me clarify that the reason that I didn't add typing for signals is that it's difficult to enforce in the compiler. Since signals use strings and variables to connect and emit, it's harder to track the origin of the signal and connected function.
Once we add first-class functions we'll be able to connect directly using a function reference, then it'll be easier to track and enforce the typing rules in signals.