Merge pull request #82030 from dalexeev/gds-make-for-loop-array-literal-typed

GDScript: Make array literal typed if `for` loop variable type is specified
This commit is contained in:
Yuri Sizov
2023-09-28 20:04:12 +02:00
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"