-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
GDScript 2.0 type introspection is broken #59696
Comments
I know i shouldn't add a second problem to the same issue, but i'm pretty sure they are related and solving the issue will probably fix both, so knowing also this problem could be helpful to debugging: it is not possible to overload any engine defined method. Adding a code like this: func add_child(node: Node, legible_unique_name: bool, internal: InternalMode)->void:
pass will throws:
The method signature match, i have also tried to use |
See also #55024. |
Recent Godot 4 updates broke the enum type introspection too, i'm adding it here because i think the issue is still the same, just another effect of the same problem: enum TestEnum {
Entry1,
Entry2,
Entry3
}
func get_enum_entry()->TestEnum:
return TestEnum.Entry1
func _ready():
print(get_enum_entry()) The result of this code is a runtime error when running the |
Godot version
v4.0.alpha.custom_build [482cdea] (i'm recompiling it daily)
System information
Linux PopOS Nvidia GTX 850M Proprietary driver using the Godot 4 Vulkan cluster backend
Issue description
GDScript 2.0 type introspection only works on variables with engine defined types.
When trying to get the type of variable with an user defined type, the
class_name
is empty (while thetype
is still correctly reported asTYPE_OBJECT
)When trying to get the types of a user defined function, all the types are not reported correctly, they are all setted as
type: 0
with emptyclass_name
. This happen on both user and engine defines types. Engine defined functions report their types correctly.There are many opened issue that i think are caused by this problem, i report some i found:
#54284
#21789
Steps to reproduce
Create a script and attach it to a
Node
, than add the following code and run it:Minimal reproduction project
This should print something like:
showing that user defined types are not reported correcty, indeed
class_name
is empty, while on user defined functions all the types are simply broken, even if all the parameters and the return type are different, they are all reported astype: 0
.To be noticed also that on user defined methods, all the parameters names are replaced with
arg0
,arg1
... while on the engine defined functions, this does not happen.The text was updated successfully, but these errors were encountered: