diff options
author | Kostis Sagonas <[email protected]> | 2016-05-04 23:38:13 +0200 |
---|---|---|
committer | Kostis Sagonas <[email protected]> | 2016-05-04 23:38:13 +0200 |
commit | 43b99183a5cdd7efbbfda8d991752e7065f9e109 (patch) | |
tree | 879a945147d61fd0efad26f2744c6f263dc7ea1f /lib/hipe | |
parent | 6a1290f534164d1a5771dba37c23124652b9f7c9 (diff) | |
download | otp-43b99183a5cdd7efbbfda8d991752e7065f9e109.tar.gz otp-43b99183a5cdd7efbbfda8d991752e7065f9e109.tar.bz2 otp-43b99183a5cdd7efbbfda8d991752e7065f9e109.zip |
Declare the erl_types:var_table() type as opaque
and do the following changes:
in erl_types: export the type and an appropriate constructor for it
in dialyzer_contracts: perform all necessary code modifications to
fix all dialyzer warnings
Although no warnings are reported by dialyzer, it's quite possible that
these are not the only places where the opacity of the var_table() data
structure is violated. But I decided to leave these places for a better
version of dialyzer to discover...
Diffstat (limited to 'lib/hipe')
-rw-r--r-- | lib/hipe/cerl/erl_types.erl | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/hipe/cerl/erl_types.erl b/lib/hipe/cerl/erl_types.erl index 84addcc105..b037a4360c 100644 --- a/lib/hipe/cerl/erl_types.erl +++ b/lib/hipe/cerl/erl_types.erl @@ -220,6 +220,7 @@ is_opaque_type/2, is_erl_type/1, atom_to_string/1, + var_table__new/0, map_pairwise_merge/3 ]). @@ -236,7 +237,7 @@ -export([t_is_identifier/1]). -endif. --export_type([erl_type/0, opaques/0, type_table/0]). +-export_type([erl_type/0, opaques/0, type_table/0, var_table/0]). %%-define(DEBUG, true). @@ -380,7 +381,7 @@ -type type_table() :: dict:dict(record_key() | type_key(), record_value() | type_value()). --type var_table() :: #{atom() => erl_type()}. +-opaque var_table() :: #{atom() => erl_type()}. %%----------------------------------------------------------------------------- %% Unions @@ -5464,6 +5465,17 @@ family(L) -> sofs:to_external(F). %%============================================================================= +%% +%% Interface functions for abstract data types defined in this module +%% +%%============================================================================= + +-spec var_table__new() -> var_table(). + +var_table__new() -> + maps:new(). + +%%============================================================================= %% Consistency-testing function(s) below %%============================================================================= |