-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Allow static typing of any object #1882
Comments
The 1878 reference was a typo its not related |
Duplicate of #192. |
@Calinou this one covers more cases |
@Shadowblitz16 Yes, but proposals should remain focused on a specific item. Proposals that are too widely scoped will be closed in favor of more specific ones. Otherwise, we'd never be able to close any proposal since each pull request would only implement a small part of them. |
ok I'll make a separate one for object then |
@Calinou wait this is specificity for object. EDIT I modified the question to be a bit more specific |
@Shadowblitz16 You can already use any class inheriting from Object as static type hint. However, a named enum is not an object type. This is why you can't use it as a type hint in GDScript. (As a workaround, you can still use an |
you right i think I was thinking of exports. |
Describe the project you are working on:
NetworkTest
Describe the problem or limitation you are having in your project:
not to the project but the static typing as a whole
Describe the feature / enhancement and how it helps to overcome the problem or limitation:
allow static typing for anything that derives from object :
as well as assignment support
:=`Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
If this enhancement will not be used often, can it be worked around with a few lines of script?:
It would be used for #173
And no it can't be worked around.
Is there a reason why this should be core and not an add-on in the asset library?:
Static typing in my opinion is far superior. not only does it allow to type information on autocomplete it also makes sure nothing is going to break or do anything its not suppose to do.
It also can be used for type checking so you don't get have cyclical dependencies and runtime include errors
The text was updated successfully, but these errors were encountered: