-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Weird error messages if trying to make a static get_name() function #84326
Comments
That's because |
static func sqrt(f: float) -> float:
return 0.0
print(Foobar.sqrt(1.0)) Also, the documentation doesn't seem to include that GDScript level |
No, |
Oh yes, |
There should be one already but might be mistaken, will investigate when I have time |
Godot version
v4.2.beta3.mono.official [e8d57af]
System information
Godot v4.2.beta3.mono - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 6GB (NVIDIA; 31.0.15.3640) - Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz (4 Threads)
Issue description
foobar.gd
:node_2d.gd
which usesFoobar:
If I try to call
Foobar
's staticget_name
with one parameter (as it is implemented), I get an error message saying that 0 arguments are expected. But when I remove the argument, now the error message says that 1 argument is expected.I'm guessing that
get_name
is a name that just cannot be used as a static function name. As a member function name it is usable.The problem here is that the current error messages do not help to understand what is going on. If a static
get_name
is not allowed at all, I would expect an error message saying just that atfoobar.gd
where I try to implement that function.Steps to reproduce
As above.
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: