mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-05 22:09:56 +03:00
Add note in GDScript reference about inference with Variant (#6934)
This commit is contained in:
@@ -760,6 +760,16 @@ Valid types are:
|
||||
- Script classes declared with the ``class_name`` keyword.
|
||||
- Autoloads registered as singletons.
|
||||
|
||||
.. note::
|
||||
|
||||
While ``Variant`` is a valid type specification, it's not an actual type. It
|
||||
only means there's no set type and is equivalent to not having a static type
|
||||
at all. Therefore, inference is not allowed by default for ``Variant``,
|
||||
since it's likely a mistake.
|
||||
|
||||
You can turn off this check, or make it only a warning, by changing it in
|
||||
the project settings. See :ref:`doc_gdscript_warning_system` for details.
|
||||
|
||||
Casting
|
||||
^^^^^^^
|
||||
|
||||
|
||||
Reference in New Issue
Block a user