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
This throws an error on assignment, because range() always returns and untyped Array even though its always an Array[int]. The docs even indirectly mention that only ints are returned:
range() converts all arguments to int before processing
To iterate over float, convert them in the loop.
Steps to reproduce
just assign range to an typed array and it fails:
varvar_name: Array[int] =range(3)
Minimal reproduction project (MRP)
The text was updated successfully, but these errors were encountered:
thanks for the fast reply.
I will leave this issue open for now as it seems there are more people that get hung up on it. Since this would break compatibility for cases such the following example it might be interesting for 5.x
Tested versions
4.3 stable
System information
Godot v4.3.stable - Windows 10 - GLES3 (Compatibility)
Issue description
I am always using typed variables as a best practice. In my code I wanted to use the following code:
This throws an error on assignment, because range() always returns and untyped Array even though its always an Array[int]. The docs even indirectly mention that only ints are returned:
Steps to reproduce
just assign range to an typed array and it fails:
Minimal reproduction project (MRP)
The text was updated successfully, but these errors were encountered: