Move fresh_uvar to type utils
This commit is contained in:
parent
6193d144a2
commit
b98af0fab6
@ -54,7 +54,6 @@ create_type_errors() -> aeso_tc_errors:create_type_errors().
|
||||
|
||||
%% -------
|
||||
|
||||
fresh_uvar(A) -> aeso_tc_env:fresh_uvar(A).
|
||||
destroy_and_report_type_errors(A) -> aeso_tc_env:destroy_and_report_type_errors(A).
|
||||
|
||||
%% -------
|
||||
@ -93,6 +92,7 @@ when_warning(A, B) -> aeso_tc_options:when_warning(A, B).
|
||||
|
||||
%% -------
|
||||
|
||||
fresh_uvar(A) -> aeso_tc_type_utils:fresh_uvar(A).
|
||||
is_first_order(A) -> aeso_tc_type_utils:is_first_order(A).
|
||||
app_t(A, B, C) -> aeso_tc_type_utils:app_t(A, B, C).
|
||||
|
||||
|
@ -49,10 +49,10 @@ type_error(A) -> aeso_tc_errors:type_error(A).
|
||||
is_monomorphic(A) -> aeso_tc_type_utils:is_monomorphic(A).
|
||||
is_first_order(A) -> aeso_tc_type_utils:is_first_order(A).
|
||||
app_t(A, B, C) -> aeso_tc_type_utils:app_t(A, B, C).
|
||||
fresh_uvar(A) -> aeso_tc_type_utils:fresh_uvar(A).
|
||||
|
||||
%% -------
|
||||
|
||||
fresh_uvar(A) -> aeso_tc_env:fresh_uvar(A).
|
||||
freshen(A) -> aeso_tc_env:freshen(A).
|
||||
create_freshen_tvars() -> aeso_tc_env:create_freshen_tvars().
|
||||
destroy_freshen_tvars() -> aeso_tc_env:destroy_freshen_tvars().
|
||||
|
@ -173,6 +173,10 @@ used_constant(A, B) -> aeso_tc_warnings:used_constant(A, B).
|
||||
get_option(A, B) -> aeso_tc_options:get_option(A, B).
|
||||
when_warning(A, B) -> aeso_tc_options:when_warning(A, B).
|
||||
|
||||
%% -------
|
||||
|
||||
fresh_uvar(A) -> aeso_tc_type_utils:fresh_uvar(A).
|
||||
|
||||
%% -- Getters ------------------------------------------------------------
|
||||
|
||||
contract_parents(#env{contract_parents = ContractParents}) ->
|
||||
@ -998,9 +1002,6 @@ unqualify1(NS, Xs) ->
|
||||
catch _:_ -> Xs
|
||||
end.
|
||||
|
||||
fresh_uvar(Attrs) ->
|
||||
{uvar, Attrs, make_ref()}.
|
||||
|
||||
create_freshen_tvars() ->
|
||||
aeso_tc_ets_manager:ets_new(freshen_tvars, [set]).
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
-module(aeso_tc_type_utils).
|
||||
|
||||
-export([ dereference/1
|
||||
-export([ fresh_uvar/1
|
||||
, dereference/1
|
||||
, dereference_deep/1
|
||||
, instantiate/1
|
||||
, typesig_to_fun_t/1
|
||||
@ -11,6 +12,10 @@
|
||||
, is_monomorphic/1
|
||||
]).
|
||||
|
||||
%% TODO: Find a better place for this function
|
||||
fresh_uvar(Attrs) ->
|
||||
{uvar, Attrs, make_ref()}.
|
||||
|
||||
dereference(T = {uvar, _, R}) ->
|
||||
case aeso_tc_ets_manager:ets_lookup(type_vars, R) of
|
||||
[] ->
|
||||
|
Loading…
x
Reference in New Issue
Block a user