Documentation: Add tip to use more specific return type for _iter_get()

This commit is contained in:
Danil Alexeev 2024-10-04 22:02:30 +03:00
parent 3576e840c7
commit a013dbc031
No known key found for this signature in database
GPG key ID: 124453E157DA8DC7

View file

@ -197,6 +197,7 @@
<param index="0" name="iter" type="Variant" />
<description>
Returns the current iterable value. [param iter] stores the iteration state, but unlike [method _iter_init] and [method _iter_next] the state is supposed to be read-only, so there is no [Array] wrapper.
[b]Tip:[/b] In GDScript, you can use a subtype of [Variant] as the return type for [method _iter_get]. The specified type will be used to infer the type of the iterator variable in [code]for[/code] loops.
</description>
</method>
<method name="_iter_init" qualifiers="virtual">