diff options
author | Henrik Nord <[email protected]> | 2015-10-27 12:28:03 +0100 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2015-10-27 12:28:03 +0100 |
commit | 990426c501e56d01d0dc0172a5335b39aafd28ec (patch) | |
tree | 6153095d0adef7d24f76a02481870d57e0cfa4dd /lib/hipe/cerl | |
parent | 36707f0eac0fdb61331a8cee4917a00a301528a3 (diff) | |
parent | d0143499cd9ff1c1cf029ff33c65c908229536c7 (diff) | |
download | otp-990426c501e56d01d0dc0172a5335b39aafd28ec.tar.gz otp-990426c501e56d01d0dc0172a5335b39aafd28ec.tar.bz2 otp-990426c501e56d01d0dc0172a5335b39aafd28ec.zip |
Merge branch 'lucafavatella/dialyzer-fun-literal-arity' into maint
* lucafavatella/dialyzer-fun-literal-arity:
Teach Dialyzer arity of funs with literal arity
OTP-13068
Diffstat (limited to 'lib/hipe/cerl')
-rw-r--r-- | lib/hipe/cerl/erl_bif_types.erl | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/hipe/cerl/erl_bif_types.erl b/lib/hipe/cerl/erl_bif_types.erl index 5387edfb47..c2fb79c089 100644 --- a/lib/hipe/cerl/erl_bif_types.erl +++ b/lib/hipe/cerl/erl_bif_types.erl @@ -768,6 +768,18 @@ type(erlang, length, 1, Xs, Opaques) -> %% Guard bif, needs to be here. type(erlang, map_size, 1, Xs, Opaques) -> strict(erlang, map_size, 1, Xs, fun (_) -> t_non_neg_integer() end, Opaques); +type(erlang, make_fun, 3, Xs, Opaques) -> + strict(erlang, make_fun, 3, Xs, + fun ([_, _, Arity]) -> + case t_number_vals(Arity, Opaques) of + [N] -> + case is_integer(N) andalso 0 =< N andalso N =< 255 of + true -> t_fun(N, t_any()); + false -> t_none() + end; + _Other -> t_fun() + end + end, Opaques); type(erlang, make_tuple, 2, Xs, Opaques) -> strict(erlang, make_tuple, 2, Xs, fun ([Int, _]) -> @@ -2361,6 +2373,8 @@ arg_types(erlang, length, 1) -> %% Guard bif, needs to be here. arg_types(erlang, map_size, 1) -> [t_map()]; +arg_types(erlang, make_fun, 3) -> + [t_atom(), t_atom(), t_arity()]; arg_types(erlang, make_tuple, 2) -> [t_non_neg_fixnum(), t_any()]; % the value 0 is OK as first argument arg_types(erlang, make_tuple, 3) -> |