diff options
| author | Thaddeus Crews <repiteo@outlook.com> | 2023-06-24 13:03:28 -0500 |
|---|---|---|
| committer | Thaddeus Crews <repiteo@outlook.com> | 2024-09-04 10:27:26 -0500 |
| commit | 9853a691447cd4e279f48820067174d3833b0065 (patch) | |
| tree | 7c774abf550b9ededc4df8fac066dbcaae393203 /modules/gdscript/tests/scripts/parser | |
| parent | 906a4e9db91c2c6b17a0cb1cddf2a96f64114646 (diff) | |
| download | redot-engine-9853a691447cd4e279f48820067174d3833b0065.tar.gz | |
Implement typed dictionaries
Diffstat (limited to 'modules/gdscript/tests/scripts/parser')
| -rw-r--r-- | modules/gdscript/tests/scripts/parser/features/typed_dictionaries.gd | 5 | ||||
| -rw-r--r-- | modules/gdscript/tests/scripts/parser/features/typed_dictionaries.out | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/parser/features/typed_dictionaries.gd b/modules/gdscript/tests/scripts/parser/features/typed_dictionaries.gd new file mode 100644 index 0000000000..57e6489484 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/features/typed_dictionaries.gd @@ -0,0 +1,5 @@ +func test(): + var my_dictionary: Dictionary[int, String] = { 1: "one", 2: "two", 3: "three" } + var inferred_dictionary := { 1: "one", 2: "two", 3: "three" } # This is Dictionary[int, String]. + print(my_dictionary) + print(inferred_dictionary) diff --git a/modules/gdscript/tests/scripts/parser/features/typed_dictionaries.out b/modules/gdscript/tests/scripts/parser/features/typed_dictionaries.out new file mode 100644 index 0000000000..6021c338ee --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/features/typed_dictionaries.out @@ -0,0 +1,3 @@ +GDTEST_OK +{ 1: "one", 2: "two", 3: "three" } +{ 1: "one", 2: "two", 3: "three" } |
