diff options
author | Hans Bolinder <[email protected]> | 2014-04-29 09:31:15 +0200 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2014-04-29 09:31:15 +0200 |
commit | be46e454e61c513920f9b3a8040d26d7c2bc8b9f (patch) | |
tree | 1ff7dc60a16eca43543d7f9558158ace31b7515f /lib/hipe | |
parent | 847e7291b2800ebd7e188be6e88114fb1e8900ce (diff) | |
parent | eb11af7f827bbbd6597b018d777993946ac3cbc0 (diff) | |
download | otp-be46e454e61c513920f9b3a8040d26d7c2bc8b9f.tar.gz otp-be46e454e61c513920f9b3a8040d26d7c2bc8b9f.tar.bz2 otp-be46e454e61c513920f9b3a8040d26d7c2bc8b9f.zip |
Merge branch 'hb/type_fixes/OTP-11851'
* hb/type_fixes/OTP-11851:
[stdlib] Simplify some linter warnings about specs
Modify representation of the map type
Disallow '_' as type variable
Fix a -callback attribute bug
Allow more type names
Diffstat (limited to 'lib/hipe')
-rw-r--r-- | lib/hipe/cerl/erl_types.erl | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/hipe/cerl/erl_types.erl b/lib/hipe/cerl/erl_types.erl index 6065b79664..473a9eba4a 100644 --- a/lib/hipe/cerl/erl_types.erl +++ b/lib/hipe/cerl/erl_types.erl @@ -4350,7 +4350,10 @@ t_from_form({type, _L, tuple, Args}, TypeNames, RecDict, VarDict) -> t_from_form({type, _L, union, Args}, TypeNames, RecDict, VarDict) -> {L, R} = list_from_form(Args, TypeNames, RecDict, VarDict), {t_sup(L), R}; +t_from_form({user_type, _L, Name, Args}, TypeNames, RecDict, VarDict) -> + type_from_form(Name, Args, TypeNames, RecDict, VarDict); t_from_form({type, _L, Name, Args}, TypeNames, RecDict, VarDict) -> + %% Compatibility. Modules compiled before 18.0. type_from_form(Name, Args, TypeNames, RecDict, VarDict); t_from_form({opaque, _L, Name, {Mod, Args, Rep}}, _TypeNames, _RecDict, _VarDict) -> @@ -4588,9 +4591,12 @@ t_form_to_string({type, _L, Name, []} = T) -> try t_to_string(t_from_form(T)) catch throw:{error, _} -> atom_to_string(Name) ++ "()" end; -t_form_to_string({type, _L, Name, List}) -> +t_form_to_string({user_type, _L, Name, List}) -> flat_format("~w(~s)", - [Name, string:join(t_form_to_string_list(List), ",")]). + [Name, string:join(t_form_to_string_list(List), ",")]); +t_form_to_string({type, L, Name, List}) -> + %% Compatibility. Modules compiled before 18.0. + t_form_to_string({user_type, L, Name, List}). t_form_to_string_list(List) -> t_form_to_string_list(List, []). |