diff options
author | Henrik Nord <[email protected]> | 2011-08-23 15:48:05 +0200 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2011-08-23 15:48:11 +0200 |
commit | 7b6bc498755be949091162ea9c32345f85f9b334 (patch) | |
tree | b0249e82727ba4804a14a3689abd5977f6783919 /lib/dialyzer/src/dialyzer_dataflow.erl | |
parent | da62065765d3512afa793d64cdc96b6995526424 (diff) | |
parent | b4f5b85d0a7f288db70093d806920d004d8b0e83 (diff) | |
download | otp-7b6bc498755be949091162ea9c32345f85f9b334.tar.gz otp-7b6bc498755be949091162ea9c32345f85f9b334.tar.bz2 otp-7b6bc498755be949091162ea9c32345f85f9b334.zip |
Merge branch 'sa/dialyzer-small-fixes' into dev
* sa/dialyzer-small-fixes:
Fix dialyzer warning on default clause for binary comprehension
Update results of race_SUITE/extract_translations
Update results of small_SUITE/flatten
Add codec_can and list_to_bitstring tests
Fix bug when reporting unused functions
Update Dialyzer's r9c_suite results
OTP-9483
Diffstat (limited to 'lib/dialyzer/src/dialyzer_dataflow.erl')
-rw-r--r-- | lib/dialyzer/src/dialyzer_dataflow.erl | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/dialyzer/src/dialyzer_dataflow.erl b/lib/dialyzer/src/dialyzer_dataflow.erl index 7137dbc036..8cb16d8f09 100644 --- a/lib/dialyzer/src/dialyzer_dataflow.erl +++ b/lib/dialyzer/src/dialyzer_dataflow.erl @@ -1414,6 +1414,17 @@ do_clause(C, Arg, ArgType0, OrigArgType, Map, false -> true end; + [Pat0, Pat1] -> % binary comprehension + case cerl:is_c_cons(Pat0) of + true -> + not (cerl:is_c_var(cerl:cons_hd(Pat0)) andalso + cerl:is_c_var(cerl:cons_tl(Pat0)) andalso + cerl:is_c_var(Pat1) andalso + cerl:is_literal(Guard) andalso + (cerl:concrete(Guard) =:= true)); + false -> + true + end; _ -> true end; false -> @@ -2915,7 +2926,7 @@ state__get_warnings(#state{tree_map = TreeMap, fun_tab = FunTab, {Warn, Msg} = case dialyzer_callgraph:lookup_name(FunLbl, Callgraph) of error -> {true, {unused_fun, []}}; - {ok, {_M, F, A}} = MFA -> + {ok, {_M, F, A} = MFA} -> {not sets:is_element(MFA, NoWarnUnused), {unused_fun, [F, A]}} end, |