@@ -6,7 +6,7 @@ defmodule Module.Types.Of do
66 @ prefix quote ( do: ... )
77 @ suffix quote ( do: ... )
88
9- alias Module.Types.Infer
9+ alias Module.Types.Unify
1010 alias Module.ParallelChecker
1111
1212 import Module.Types.Helpers
@@ -40,7 +40,7 @@ defmodule Module.Types.Of do
4040 defp pairs_to_unions ( [ { key , value } ] , _context ) , do: [ { :required , key , value } ]
4141
4242 defp pairs_to_unions ( pairs , context ) do
43- case Enum . split_with ( pairs , fn { key , _value } -> Infer . has_unbound_var? ( key , context ) end ) do
43+ case Enum . split_with ( pairs , fn { key , _value } -> Unify . has_unbound_var? ( key , context ) end ) do
4444 { [ ] , pairs } -> pairs_to_unions ( pairs , [ ] , context )
4545 { [ _ | _ ] , pairs } -> pairs_to_unions ( [ { :dynamic , :dynamic } | pairs ] , [ ] , context )
4646 end
@@ -57,17 +57,17 @@ defmodule Module.Types.Of do
5757 find_subtype_values ( ahead , key , context ) ++
5858 find_subtype_values ( behind , key , context )
5959
60- pairs_to_unions ( ahead , [ { key , Infer . to_union ( all_values , context ) } | behind ] , context )
60+ pairs_to_unions ( ahead , [ { key , Unify . to_union ( all_values , context ) } | behind ] , context )
6161 end
6262
6363 defp pairs_to_unions ( [ ] , acc , context ) do
6464 acc
65- |> Enum . sort ( & Infer . subtype? ( elem ( & 1 , 0 ) , elem ( & 2 , 0 ) , context ) )
65+ |> Enum . sort ( & Unify . subtype? ( elem ( & 1 , 0 ) , elem ( & 2 , 0 ) , context ) )
6666 |> Enum . map ( fn { key , value } -> { :required , key , value } end )
6767 end
6868
6969 defp find_subtype_values ( pairs , key , context ) do
70- for { pair_key , pair_value } <- pairs , Infer . subtype? ( pair_key , key , context ) , do: pair_value
70+ for { pair_key , pair_value } <- pairs , Unify . subtype? ( pair_key , key , context ) , do: pair_value
7171 end
7272
7373 defp find_matching_values ( [ { key , value } | ahead ] , key , acc , values ) do
@@ -153,7 +153,7 @@ defmodule Module.Types.Of do
153153
154154 true ->
155155 with { :ok , type , context } <- fun . ( expr , stack , context ) ,
156- { :ok , _type , context } <- Infer . unify ( type , expected_type , stack , context ) ,
156+ { :ok , _type , context } <- Unify . unify ( type , expected_type , stack , context ) ,
157157 do: { :ok , context }
158158 end
159159 end
0 commit comments