diff options
| author | Danil Alexeev <danil@alexeev.xyz> | 2023-09-21 11:14:28 +0300 |
|---|---|---|
| committer | Danil Alexeev <danil@alexeev.xyz> | 2023-09-21 11:25:59 +0300 |
| commit | 3c35e7f1d6ff3aaed360afca3ba1638ec4335aec (patch) | |
| tree | ffb9b54015afe043893e99b85ceeb8bbcc6b232c /modules/gdscript/tests/scripts/runtime | |
| parent | 59139df16e7a10c3b9176f697d23b557af46601e (diff) | |
| download | redot-engine-3c35e7f1d6ff3aaed360afca3ba1638ec4335aec.tar.gz | |
GDScript: Make array literal typed if `for` loop variable type is specified
Diffstat (limited to 'modules/gdscript/tests/scripts/runtime')
| -rw-r--r-- | modules/gdscript/tests/scripts/runtime/features/for_loop_iterator_specified_types.gd | 6 | ||||
| -rw-r--r-- | modules/gdscript/tests/scripts/runtime/features/for_loop_iterator_specified_types.out | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/runtime/features/for_loop_iterator_specified_types.gd b/modules/gdscript/tests/scripts/runtime/features/for_loop_iterator_specified_types.gd index 58b4df5a79..bc899a3a6f 100644 --- a/modules/gdscript/tests/scripts/runtime/features/for_loop_iterator_specified_types.gd +++ b/modules/gdscript/tests/scripts/runtime/features/for_loop_iterator_specified_types.gd @@ -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: diff --git a/modules/gdscript/tests/scripts/runtime/features/for_loop_iterator_specified_types.out b/modules/gdscript/tests/scripts/runtime/features/for_loop_iterator_specified_types.out index f67f7d89d5..eeebdc4be5 100644 --- a/modules/gdscript/tests/scripts/runtime/features/for_loop_iterator_specified_types.out +++ b/modules/gdscript/tests/scripts/runtime/features/for_loop_iterator_specified_types.out @@ -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" |
