aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dialyzer')
-rw-r--r--lib/dialyzer/doc/src/notes.xml66
-rw-r--r--lib/dialyzer/src/dialyzer_contracts.erl11
-rw-r--r--lib/dialyzer/test/small_SUITE_data/src/loopy.erl17
3 files changed, 24 insertions, 70 deletions
diff --git a/lib/dialyzer/doc/src/notes.xml b/lib/dialyzer/doc/src/notes.xml
index 6e335ac3c1..d9af2cb4cd 100644
--- a/lib/dialyzer/doc/src/notes.xml
+++ b/lib/dialyzer/doc/src/notes.xml
@@ -32,72 +32,6 @@
<p>This document describes the changes made to the Dialyzer
application.</p>
-<section><title>Dialyzer 3.0</title>
-
- <section><title>Fixed Bugs and Malfunctions</title>
- <list>
- <item>
- <p> Fix a bug in the translation of forms to types. </p>
- <p>
- Own Id: OTP-13520</p>
- </item>
- <item>
- <p>Correct mispelling in Dialyzer's acronym definition.
- </p>
- <p>
- Own Id: OTP-13544 Aux Id: PR-1007 </p>
- </item>
- <item>
- <p>Dialyzer no longer crashes when there is an invalid
- function call such as <c>42(7)</c> in a module being
- analyzed. The compiler will now warn for invalid function
- calls such as <c>X = 42, x(7)</c>. (ERL-138. Thanks to
- Daniel Feltey for reporting this bug.)</p>
- <p>
- Own Id: OTP-13552</p>
- </item>
- </list>
- </section>
-
-
- <section><title>Improvements and New Features</title>
- <list>
- <item>
- <p> The evaluation of SCCs in <c>dialyzer_typesig</c> is
- optimized. </p> <p> Maps are used instead of Dicts to
- further optimize the evalutation. </p>
- <p>
- Own Id: OTP-10349</p>
- </item>
- <item>
- <p> Since Erlang/OTP R14A, when support for parameterized
- modules was added, <c>module()</c> has included
- <c>tuple()</c>, but that part is removed; the type
- <c>module()</c> is now the same as <c>atom()</c>, as
- documented in the Reference Manual. </p>
- <p>
- Own Id: OTP-13244</p>
- </item>
- <item>
- <p> The type specification syntax for Maps is improved:
- </p> <list> <item> <p> The association type <c>KeyType :=
- ValueType</c> denotes an association that must be
- present. </p> </item> <item> <p> The shorthand <c>...</c>
- stands for the association type <c>any() => any()</c>.
- </p> </item> </list> <p> An incompatible change is that
- <c>#{}</c> stands for the empty map. The type
- <c>map()</c> (a map of any size) can be written as
- <c>#{...}</c>. </p>
- <p>
- *** POTENTIAL INCOMPATIBILITY ***</p>
- <p>
- Own Id: OTP-13542 Aux Id: PR-1014 </p>
- </item>
- </list>
- </section>
-
-</section>
-
<section><title>Dialyzer 2.9</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/dialyzer/src/dialyzer_contracts.erl b/lib/dialyzer/src/dialyzer_contracts.erl
index d1ffa07706..272ad10e90 100644
--- a/lib/dialyzer/src/dialyzer_contracts.erl
+++ b/lib/dialyzer/src/dialyzer_contracts.erl
@@ -591,10 +591,13 @@ remove_uses([{Var, Use}|ToRemove], Constrs0) ->
remove_uses(_Var, _Use, []) -> [];
remove_uses(Var, Use, [Constr|Constrs]) ->
{V, Form} = Constr,
- case erl_types:t_var_name(V) =:= Var of
- true -> [{V, remove_use(Form, Use)}|Constrs];
- false -> [Constr|remove_uses(Var, Use, Constrs)]
- end.
+ NewConstr = case erl_types:t_var_name(V) =:= Var of
+ true ->
+ {V, remove_use(Form, Use)};
+ false ->
+ Constr
+ end,
+ [NewConstr|remove_uses(Var, Use, Constrs)].
remove_use({var, L, V}, V) -> {var, L, '_'};
remove_use(T, V) when is_tuple(T) ->
diff --git a/lib/dialyzer/test/small_SUITE_data/src/loopy.erl b/lib/dialyzer/test/small_SUITE_data/src/loopy.erl
new file mode 100644
index 0000000000..28125ec3d9
--- /dev/null
+++ b/lib/dialyzer/test/small_SUITE_data/src/loopy.erl
@@ -0,0 +1,17 @@
+%% ERL-157, OTP-13653.
+%% Would cause Dialyzer to go into an infinite loop.
+
+-module(loopy).
+
+-export([loop/1]).
+
+
+-spec loop(Args) -> ok when
+ Args :: [{Module, Args}],
+ Module :: module(),
+ Args :: any().
+loop([{Module, Args} | Rest]) ->
+ Module:init(Args),
+ loop(Rest);
+loop([]) ->
+ ok.