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
Describe the problem or limitation you are having in your project
Sometimes for small projects, you might not want to use static typing, to save time. But as projects get bigger, it can be very helpful. The issue is when you move to static typing, a lot of the time you forget to use it when declaring variables and functions. Typing = instead of := and forgetting the types for the parameters of a method and its return type. It's nice to switch back and forth from dynamic and static depending on the project, so having warnings would force you to not forget about typing when working with it.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Add warnings/errors in the project settings that warns you whenever you declare variables, methods etc. without a type would be very useful. There's always probably other things that violate type-safety that I'm forgetting, too, that could use warnings.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
In the projects settings > Debug > GDscript, there could be a set of new type-safety warnings to enable. It would also be useful to split the type warnings into a sub-section, so you can see them all in one place.
If this enhancement will not be used often, can it be worked around with a few lines of script?
This would have to be part of the engine.
Is there a reason why this should be core and not an add-on in the asset library?
I'm not sure if addons can do something like this.
The text was updated successfully, but these errors were encountered:
JamesC01
changed the title
Add warnings/error when not setting a variables type or method return type
Add warnings/error when not setting a variable or method return type.
Sep 16, 2023
JamesC01
changed the title
Add warnings/error when not setting a variable or method return type.
Add warnings/error to ensure variables and method return/params have a type.
Sep 16, 2023
JamesC01
changed the title
Add warnings/error to ensure variables and method return/params have a type.
Add warnings/error to ensure variables and method return/params use static typing
Sep 16, 2023
Oh, awesome! Sorry for the duplicate, I did search, but it's right at the bottom of the closed issues, and I didn't see it. So strange that we both had the same idea 4 days within eachother. edit: never mind, it was just the pull request was 4 days ago, the actual proposal was years ago. Still strange that it was completed so closely to when I thought of this, though.
Describe the project you are working on
Games.
Describe the problem or limitation you are having in your project
Sometimes for small projects, you might not want to use static typing, to save time. But as projects get bigger, it can be very helpful. The issue is when you move to static typing, a lot of the time you forget to use it when declaring variables and functions. Typing = instead of := and forgetting the types for the parameters of a method and its return type. It's nice to switch back and forth from dynamic and static depending on the project, so having warnings would force you to not forget about typing when working with it.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Add warnings/errors in the project settings that warns you whenever you declare variables, methods etc. without a type would be very useful. There's always probably other things that violate type-safety that I'm forgetting, too, that could use warnings.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
In the projects settings > Debug > GDscript, there could be a set of new type-safety warnings to enable. It would also be useful to split the type warnings into a sub-section, so you can see them all in one place.
If this enhancement will not be used often, can it be worked around with a few lines of script?
This would have to be part of the engine.
Is there a reason why this should be core and not an add-on in the asset library?
I'm not sure if addons can do something like this.
The text was updated successfully, but these errors were encountered: