Implement typed dictionaries

This commit is contained in:
Thaddeus Crews 2023-06-24 13:03:28 -05:00
parent 906a4e9db9
commit 9853a69144
No known key found for this signature in database
GPG key ID: 62181B86FE9E5D84
86 changed files with 3071 additions and 193 deletions

View file

@ -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)

View file

@ -0,0 +1,3 @@
GDTEST_OK
{ 1: "one", 2: "two", 3: "three" }
{ 1: "one", 2: "two", 3: "three" }