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
Static GDScript Typing Variant #26228
Comments
Ignoring the return type is effectively the same as returning Variant. |
Yeah but that doesn't fix the problem. What do you do with the other virtual methods that expect |
|
I like the idea of a generic type hint too (similar to TypeScript's We could then have a GDScript warning (disabled by default) that would be emitted whenever type hints aren't specified somewhere. |
Closing in favor of godotengine/godot-proposals#605, as feature proposals are now tracked on the Godot proposals repository. |
For anyone stumbling upon this issue from a web search, this is now supported in |
On latest static GDScript typing, there are some virtual functions that return
Variant
, and there's no way to replicate that in GDScript. What comes to mind isObject._get
function for example. There's no way to sayfunc _get(property: String) -> Variant
in GDScript, "best" implementation so far is to ignore return value:func _get(property: String)
.We need a mechanism to return not just Object & built-in types but
Variant
as well or maybe there are other options out there too?The text was updated successfully, but these errors were encountered: