diff options
author | Hans Bolinder <[email protected]> | 2016-08-30 10:53:30 +0200 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2016-08-31 15:01:43 +0200 |
commit | 0ca1c088b5cf03357154c0b9178d99893f0eaf5c (patch) | |
tree | abe31594d208bc6a4fe262bc85030bf447f52fca /lib/hipe/cerl | |
parent | f3e018dc3bb3c74b88c7454f6a1888938215f912 (diff) | |
download | otp-0ca1c088b5cf03357154c0b9178d99893f0eaf5c.tar.gz otp-0ca1c088b5cf03357154c0b9178d99893f0eaf5c.tar.bz2 otp-0ca1c088b5cf03357154c0b9178d99893f0eaf5c.zip |
dialyzer: Optimize an opaque type case
Fix a mistake in commit 85f6fe3b.
Instead of using the declared opaque type, the form's type is used in
a case where the opaque type is turned into a non-opaque type. The
result is more general types (smaller Erlang terms) and faster
analyses.
Diffstat (limited to 'lib/hipe/cerl')
-rw-r--r-- | lib/hipe/cerl/erl_types.erl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/hipe/cerl/erl_types.erl b/lib/hipe/cerl/erl_types.erl index 243bb6e25d..c9dd1051f3 100644 --- a/lib/hipe/cerl/erl_types.erl +++ b/lib/hipe/cerl/erl_types.erl @@ -4749,7 +4749,7 @@ type_from_form1(Name, Args, ArgsLen, R, TypeName, TypeNames, S, D, L, C) -> {Rep, L2, C2} = recur_limit(Fun, D, L1, TypeName, TypeNames), Rep1 = choose_opaque_type(Rep, Type), Rep2 = case cannot_have_opaque(Rep1, TypeName, TypeNames) of - true -> Rep1; + true -> Rep; false -> ArgTypes2 = subst_all_vars_to_any_list(ArgTypes), t_opaque(Module, Name, ArgTypes2, Rep1) @@ -4821,7 +4821,7 @@ remote_from_form1(RemMod, Name, Args, ArgsLen, RemDict, RemType, TypeNames, NewRep1 = choose_opaque_type(NewRep, Type), NewRep2 = case cannot_have_opaque(NewRep1, RemType, TypeNames) of - true -> NewRep1; + true -> NewRep; false -> ArgTypes2 = subst_all_vars_to_any_list(ArgTypes), t_opaque(Mod, Name, ArgTypes2, NewRep1) |