-
-
Notifications
You must be signed in to change notification settings - Fork 20.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warn on connected functions without correct argument count #12450
Comments
Maybe users should even be warned when overriding methods, e.g. defining |
Any tips on where to start digging into this? I'd like to see if I can get this added :) |
Some pointers which I guess might be useful, from
Lines 1116 to 1131 in 62a3dcd
godot/modules/gdscript/gd_function.cpp Lines 285 to 287 in 62a3dcd
Lines 818 to 832 in 62a3dcd
Lines 600 to 618 in 62a3dcd
|
I can try adding a lint message for this. |
I've tinkered a bit now and I think I'm slowly getting somewhere. This is my first attempt to contribute to Godot, so I still need to spend a lot of time just browsing the source code. I have one question: Is there any simple way to get the |
In current master it gives something like:
It does need a better warning. |
Operating system or device, Godot version, GPU Model and driver (if graphics related):
MacOS, Godot 3.0 alpha
Issue description:
Connecting a signal to a function that doesn't have the correct number of arguments means that the function is never called (and I haven't seen any warnings in the debugger being called). Ideally, either the editor puts a lint warning up, or when attempting to call the function it complains that the function is invalid.
Steps to reproduce:
I connected a no-argument function to an animation_finished callback, which never is called. Can upload examples if needed!
Link to minimal example project:
Happy to make one if it helps; might poke around to see if I can cobble something together!
The text was updated successfully, but these errors were encountered: