Skip to content

Commit

Permalink
[*] Add dictionary static typing
Browse files Browse the repository at this point in the history
  • Loading branch information
IceflowRE committed Sep 10, 2024
1 parent b6dfcf7 commit 46ecc67
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const IconSimpleIcons := preload("res://addons/icon_explorer/internal/ext/simple
const ZipUnpacker := preload("res://addons/icon_explorer/internal/scripts/tools/zip_unpacker.gd")

const _DOWNLOAD_FILE: String = "https://github.com/simple-icons/simple-icons/archive/master.zip"
var _TITLE_TO_SLUG_REPLACEMENTS: Dictionary = {
var _TITLE_TO_SLUG_REPLACEMENTS: Dictionary[String, String] = {
"+": "plus",
".": "dot",
"&": "and",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func unpack_mt(thread_count: int) -> bool:
return true

func _create_directories(paths: PackedStringArray) -> bool:
var created: Dictionary = {}
var created: Dictionary[String, Object] = {}
for path: String in paths:
var dir_path: String = path.get_base_dir()
if (!self._has_filter() || self._is_in_filter(path)) && !(dir_path in created):
Expand Down
2 changes: 1 addition & 1 deletion addons/qr_code/qr_code.gd
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ const _DATA_CAPACITY: Array[Dictionary] = [
},
]

const _ALPHANUMERIC_CHARACTERS: Dictionary = {
const _ALPHANUMERIC_CHARACTERS: Dictionary[String, int] = {
"0" : 0,
"1" : 1,
"2" : 2,
Expand Down
4 changes: 2 additions & 2 deletions examples/licenses/display_licenses.gd
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func _populate_tree() -> void:

# populate the tree node
# create a category cache to easily access already created category items
var category_cache: Dictionary = {}
var category_cache: Dictionary[String, TreeItem] = {}
var root: TreeItem = self._tree.create_item(null)
category_cache[""] = root

Expand All @@ -50,7 +50,7 @@ func _populate_tree() -> void:
item.set_meta("idx", idx)

## create a category item in the tree
func _create_category_item(category_cache: Dictionary, category: String, root: TreeItem) -> TreeItem:
func _create_category_item(category_cache: Dictionary[String, TreeItem], category: String, root: TreeItem) -> TreeItem:
if category in category_cache:
return category_cache[category]
var category_item: TreeItem
Expand Down

0 comments on commit 46ecc67

Please sign in to comment.