1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +00:00

GDScript: Make array literal typed if for loop variable type is specified

This commit is contained in:
Danil Alexeev
2023-09-21 11:14:28 +03:00
parent 59139df16e
commit 3c35e7f1d6
5 changed files with 30 additions and 7 deletions

View File

@@ -21,6 +21,12 @@ func test():
var elem := e
prints(var_to_str(e), var_to_str(elem))
# GH-82021
print("Test implicitly typed array literal.")
for e: float in [100, 200, 300]:
var elem := e
prints(var_to_str(e), var_to_str(elem))
print("Test String-keys dictionary.")
var d1 := {a = 1, b = 2, c = 3}
for k: StringName in d1:

View File

@@ -15,6 +15,10 @@ Test typed int array.
10.0 10.0
20.0 20.0
30.0 30.0
Test implicitly typed array literal.
100.0 100.0
200.0 200.0
300.0 300.0
Test String-keys dictionary.
&"a" &"a"
&"b" &"b"