aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2015-08-19 09:26:20 +0200
committerHans Bolinder <[email protected]>2015-08-19 09:26:20 +0200
commit561d22bdc961e66ca281bf0777c830ced0556a1f (patch)
tree81d3c14c72bcd332bf17d55c8c8108e4aa4296ba /lib/hipe
parente66d39c0f3c6966c4d281c3156942e07fd695d58 (diff)
parentfe349b73219d4b481cd6063d1c931c0ff202ab73 (diff)
downloadotp-561d22bdc961e66ca281bf0777c830ced0556a1f.tar.gz
otp-561d22bdc961e66ca281bf0777c830ced0556a1f.tar.bz2
otp-561d22bdc961e66ca281bf0777c830ced0556a1f.zip
Merge branch 'maint'
* maint: dialyzer: Fix a bug concerning parameterized opaque types
Diffstat (limited to 'lib/hipe')
-rw-r--r--lib/hipe/cerl/erl_types.erl12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/hipe/cerl/erl_types.erl b/lib/hipe/cerl/erl_types.erl
index 25cf1a7ae1..a28dfb9e05 100644
--- a/lib/hipe/cerl/erl_types.erl
+++ b/lib/hipe/cerl/erl_types.erl
@@ -4244,9 +4244,8 @@ type_from_form(Name, Args, TypeNames, ET, M, MR, V, D, L) ->
Rep2 = case t_is_none(Rep1) of
true -> Rep1;
false ->
- Args2 = [subst_all_vars_to_any(ArgType) ||
- ArgType <- ArgTypes],
- t_opaque(Module, Name, Args2, Rep1)
+ ArgTypes2 = subst_all_vars_to_any_list(ArgTypes),
+ t_opaque(Module, Name, ArgTypes2, Rep1)
end,
{Rep2, L2};
error ->
@@ -4298,7 +4297,9 @@ remote_from_form(RemMod, Name, Args, TypeNames, ET, M, MR, V, D, L) ->
NewRep1 = choose_opaque_type(NewRep, Type),
NewRep2 = case t_is_none(NewRep1) of
true -> NewRep1;
- false -> t_opaque(Mod, Name, ArgTypes, NewRep1)
+ false ->
+ ArgTypes2 = subst_all_vars_to_any_list(ArgTypes),
+ t_opaque(Mod, Name, ArgTypes2, NewRep1)
end,
{NewRep2, L2};
error ->
@@ -4313,6 +4314,9 @@ remote_from_form(RemMod, Name, Args, TypeNames, ET, M, MR, V, D, L) ->
end
end.
+subst_all_vars_to_any_list(Types) ->
+ [subst_all_vars_to_any(Type) || Type <- Types].
+
%% Opaque types (both local and remote) are problematic when it comes
%% to the limits (TypeNames, D, and L). The reason is that if any() is
%% substituted for a more specialized subtype of an opaque type, the