aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/src
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2014-08-19 16:16:08 +0200
committerHans Bolinder <[email protected]>2014-08-20 16:53:56 +0200
commit6e422d499fe079b87cfa226491b11016f36b9a31 (patch)
tree1b795507c5c1a4eff77ddf0991669a71154b9e67 /lib/dialyzer/src
parentc56edba2912e12f15226a1e130fdfac25c29b98f (diff)
downloadotp-6e422d499fe079b87cfa226491b11016f36b9a31.tar.gz
otp-6e422d499fe079b87cfa226491b11016f36b9a31.tar.bz2
otp-6e422d499fe079b87cfa226491b11016f36b9a31.zip
dialyzer: fix a -Wunderspecs bug
Sometimes bogus warnings were generated for parametrized types. Thanks to Krzesimir Sarnecki for pointing the bug out. Also corrected warnings where the structure of opaque types were exposed (thanks to Kostis for pointing the bug out).
Diffstat (limited to 'lib/dialyzer/src')
-rw-r--r--lib/dialyzer/src/dialyzer_contracts.erl7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/dialyzer/src/dialyzer_contracts.erl b/lib/dialyzer/src/dialyzer_contracts.erl
index 1d2dfc7b2d..f27fc1a842 100644
--- a/lib/dialyzer/src/dialyzer_contracts.erl
+++ b/lib/dialyzer/src/dialyzer_contracts.erl
@@ -20,8 +20,6 @@
-module(dialyzer_contracts).
--compile(export_all).
-
-export([check_contract/2,
check_contracts/4,
contracts_without_fun/3,
@@ -686,7 +684,7 @@ picky_contract_check(CSig0, Sig0, MFA, FileLine, Contract, RecDict, Acc) ->
true -> Acc;
false ->
case extra_contract_warning(MFA, FileLine, Contract,
- CSig, Sig, RecDict) of
+ CSig0, Sig0, RecDict) of
no_warning -> Acc;
{warning, Warning} -> [Warning|Acc]
end
@@ -752,7 +750,8 @@ is_remote_types_related(Contract, CSig, Sig, RecDict) ->
t_from_forms_without_remote([{FType, []}], RecDict) ->
Type0 = erl_types:t_from_form(FType, RecDict),
- {ok, erl_types:subst_all_remote(Type0, erl_types:t_none())};
+ Type1 = erl_types:subst_all_remote(Type0, erl_types:t_none()),
+ {ok, erl_types:subst_all_vars_to_any(Type1)};
t_from_forms_without_remote([{_FType, _Constrs}], _RecDict) ->
%% 'When' constraints
unsupported;