Skip to content

Commit 5b56fa1

Browse files
committed
Dialyzer green
1 parent e94648d commit 5b56fa1

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

lib/cldr/timezone.ex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ defmodule Cldr.Timezone do
1414
"""
1515
alias Cldr.Locale
1616

17+
@type short_zone :: String.t()
18+
1719
@type timezone :: %{
1820
aliases: [String.t(), ...],
19-
preferred: nil | Locale.territory_code(),
21+
preferred: nil | short_zone(),
2022
territory: Locale.territory_code()
2123
}
2224
@unknown_zone "Etc/Unknown"
@@ -71,6 +73,7 @@ defmodule Cldr.Timezone do
7173
territory.
7274
7375
"""
76+
@dialyzer {:nowarn_function, timezones_by_territory: 0}
7477
def timezones_by_territory do
7578
@timezones_by_territory
7679
end

lib/cldr/type.ex

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
defmodule Cldr.Type do
22
@moduledoc false
33

4+
alias Cldr.Timezone
5+
46
# Convert a map to a typespec
57
def number_systems() do
68
systems_ast =
@@ -47,7 +49,7 @@ defmodule Cldr.Type do
4749
def timezones_by_territory(territory_timezones) do
4850
timezone_ast =
4951
Enum.map(territory_timezones, fn {territory, _timezones} ->
50-
{territory, string_list()}
52+
{territory, territory_list()}
5153
end)
5254

5355
{:%{}, [], timezone_ast}
@@ -82,9 +84,9 @@ defmodule Cldr.Type do
8284
{{:., [], [{:__aliases__, [alias: false], [:String]}, :t]}, [], []}
8385
end
8486

85-
defp string_list do
87+
defp territory_list do
8688
quote do
87-
[String.t(), ...]
89+
[Timezone.timezone(), ...]
8890
end
8991
end
9092

0 commit comments

Comments
 (0)