diff options
author | Hans Bolinder <[email protected]> | 2012-08-21 10:48:26 +0200 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2012-08-21 10:48:26 +0200 |
commit | 2502f65bd14be4132a12c6fb7fd51c227603a017 (patch) | |
tree | 4789f2dadcbd3f87ec73e50c2ff7035ffc1a15cb /lib/dialyzer | |
parent | d07c8e98d6924471879034bf801e19658cabbd54 (diff) | |
parent | 064b42237d891d5fdcb6c1a351980b8291437618 (diff) | |
download | otp-2502f65bd14be4132a12c6fb7fd51c227603a017.tar.gz otp-2502f65bd14be4132a12c6fb7fd51c227603a017.tar.bz2 otp-2502f65bd14be4132a12c6fb7fd51c227603a017.zip |
Merge branch 'maint'
* maint:
Let t_inf() substitute any() for variables in a few more cases
Fix a bug in dialyzer_dataflow
Diffstat (limited to 'lib/dialyzer')
-rw-r--r-- | lib/dialyzer/src/dialyzer_dataflow.erl | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/dialyzer/src/dialyzer_dataflow.erl b/lib/dialyzer/src/dialyzer_dataflow.erl index cb376daf68..7131633da1 100644 --- a/lib/dialyzer/src/dialyzer_dataflow.erl +++ b/lib/dialyzer/src/dialyzer_dataflow.erl @@ -2468,14 +2468,18 @@ join_maps(Maps, MapOut) -> Keys = ordsets:from_list(dict:fetch_keys(Dict) ++ dict:fetch_keys(Subst)), join_maps(Keys, Maps, MapOut). -join_maps([Key|Left], Maps, MapOut) -> +join_maps(Keys, Maps, MapOut) -> + KTs = join_maps_collect(Keys, Maps, MapOut), + lists:foldl(fun({K, T}, M) -> enter_type(K, T, M) end, MapOut, KTs). + +join_maps_collect([Key|Left], Maps, MapOut) -> Type = join_maps_one_key(Maps, Key, t_none()), case t_is_equal(lookup_type(Key, MapOut), Type) of - true -> join_maps(Left, Maps, MapOut); - false -> join_maps(Left, Maps, enter_type(Key, Type, MapOut)) + true -> join_maps_collect(Left, Maps, MapOut); + false -> [{Key, Type} | join_maps_collect(Left, Maps, MapOut)] end; -join_maps([], _Maps, MapOut) -> - MapOut. +join_maps_collect([], _Maps, _MapOut) -> + []. join_maps_one_key([Map|Left], Key, AccType) -> case t_is_any(AccType) of |