Skip to content
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

get_method_list() returns wrong information about methods in GDScript #50415

Closed
sian2005 opened this issue Jul 13, 2021 · 3 comments
Closed

get_method_list() returns wrong information about methods in GDScript #50415

sian2005 opened this issue Jul 13, 2021 · 3 comments

Comments

@sian2005
Copy link

sian2005 commented Jul 13, 2021

Godot version

v3.2.4.rc1.official

System information

Windows 10

Issue description

As a quick declaration before further investigation, get_method_list() returns everything correctly on engine declared methods, but it does not on GDScript's. There, properties of arguments revert to defaults, like the name property gets arg0, arg1, ..., same as the types, hints, ...

To further clarify, here's a screenshot from a function I created in GDScript explicitly mentioning the type and the default value:
image

On a breakpoint after declaration of the variable "method", (= "test" from get_method_list())
You can first see that the variable with type int (= 2) just gets 0, same as the hint, hint_string, and the usage, which is always 7. This too applies on the second and third argument. (They are exactly thesame exept for the name: arg1 and arg2)
image

The default arguments, (the second and third argument on the method "test"), also do not appear.
image

And as you might've guessed, the "return" specifications also does not represent the one in the method.
image

issue #33624 is similar

Steps to reproduce

Create a method which you call in de ready function that

  • firstly iterates upon the get_method_list() in a for loop and stores the specific function, in my case "test", in a variable:
    image

  • Then, create a breakpoint, or type breakpoint after the for loop:
    image

  • Finally, run the project and examine the results in the debugger.

Minimal reproduction project

Here: Minimal Reproduction Project of get_method_list() bug.zip you can find the minimal reproduction project.

There are comments in the Script.gd:

Check for the Dictionary "method" in Locals in the debugger when you run the project.
There, you can open "args", "default_args" and the "return" specifications.

@timothyqiu
Copy link
Member

Duplicate of #33624.

@sian2005
Copy link
Author

Duplicate of #33624.

The other issue is similar, but its not a duplicate. My confusion came from it being tagged topic:core, and mine is topic:gdscript, so I thought I could make a new one, and make it a bit more tidy than the previous xD

@timothyqiu
Copy link
Member

I added the "topic:gdscript" because it's the GDScript implementation of that method that has the bug. Other modules like VisualScript implemented the method but seems work fine.

It's fine to open an issue if you're not sure whether it's a duplicate :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants