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
Issue description:
The docs should contain some information that an untyped variable's value can be null, but a non-Object-typed statically typed variable cannot. Probably something along the lines of this:
An untyped variable can contain a null value, and variables that are statically typed with an Object-derived class can contain null, but variables containing primitive types (such as int, Array, and Vector3) cannot be null.
I think the main source of this confusion is a lack of documentation about where the type is stored (e.g. is the type something that only exists on variables, or is it an inherent property in the object/primitive?), so maybe that could get more clarification as well.
As a new Godot dev I find the current way things work in GDScript to be quite confusing. Some types are allowed to be null and can be checked i.e. if value: but others will produce errors. Nullable types could introduce some more clarity in regards to whether something should be null or not. null checking is very useful for things like custom resources! I hope so see this added soon.
Your Godot version:
4.4dev3
Issue description:
The docs should contain some information that an untyped variable's value can be
null
, but a non-Object-typed statically typed variable cannot. Probably something along the lines of this:I think the main source of this confusion is a lack of documentation about where the type is stored (e.g. is the type something that only exists on variables, or is it an inherent property in the object/primitive?), so maybe that could get more clarification as well.
Also see this person's comment: godotengine/godot-proposals#162 (comment):
URL to the documentation page (if already existing):
https://docs.godotengine.org/en/latest/tutorials/scripting/gdscript/gdscript_basics.html#data
The text was updated successfully, but these errors were encountered: