You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been working on porting the Nakama client to Godot 4. In Godot 3, it uses this pattern where there's a bunch of "namespaces" (*.gd scripts with lots of inner classes - they are automatically generated from Swagger definitions) and some generic methods that take the inner class as an argument, so that it knows what class to wrap the response from the server in.
Anyway, while working on this, I discovered that typehints on these inner classes don't work (ie. they won't correctly recognize the class as being the class) if they are created from the GDScript resource. I get a runtime error like:
Trying to return value of type "InnerClass1" from a function which the return type is "MyNamespace"
I cannot reproduce this on current master. It might have been fixed with other changes, so I'm closing this. If that's not the case let me know and I'll reopen.
Godot version
v4.0.alpha.custom_build.532e253a7
System information
Linux, Vulkan, 1070M
Issue description
I've been working on porting the Nakama client to Godot 4. In Godot 3, it uses this pattern where there's a bunch of "namespaces" (*.gd scripts with lots of inner classes - they are automatically generated from Swagger definitions) and some generic methods that take the inner class as an argument, so that it knows what class to wrap the response from the server in.
Anyway, while working on this, I discovered that typehints on these inner classes don't work (ie. they won't correctly recognize the class as being the class) if they are created from the GDScript resource. I get a runtime error like:
This may be related to issue #61635
Steps to reproduce
I've included a minimal reproduction project below, but here is the key code (from the Main.gd in the project) to illustrate the problem:
Minimal reproduction project
godot-4-typehint-bug.zip
The text was updated successfully, but these errors were encountered: