aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/test/user_SUITE_data/src/wpc_hlines.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2016-06-09 09:57:37 +0200
committerHans Bolinder <[email protected]>2016-06-09 09:57:37 +0200
commit26316068ca1ca815a5d5f13a8769ab9e1ab60f5c (patch)
tree795be4b5ba7654afb11416d613807cac8cb741af /lib/dialyzer/test/user_SUITE_data/src/wpc_hlines.erl
parent2da08a037e4315a1010769b22610ca81462d813d (diff)
parentb13412d2e4331fa426a6722a04310cbcbf1731d6 (diff)
downloadotp-26316068ca1ca815a5d5f13a8769ab9e1ab60f5c.tar.gz
otp-26316068ca1ca815a5d5f13a8769ab9e1ab60f5c.tar.bz2
otp-26316068ca1ca815a5d5f13a8769ab9e1ab60f5c.zip
Merge branch 'stavros/dialyzer/fix_call_site_analysis/OTP-13655/PR-1092'
* stavros/dialyzer/fix_call_site_analysis/OTP-13655/PR-1092: Fix a bug in Dialyzer related to call-site analysis
Diffstat (limited to 'lib/dialyzer/test/user_SUITE_data/src/wpc_hlines.erl')
-rw-r--r--lib/dialyzer/test/user_SUITE_data/src/wpc_hlines.erl22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/dialyzer/test/user_SUITE_data/src/wpc_hlines.erl b/lib/dialyzer/test/user_SUITE_data/src/wpc_hlines.erl
new file mode 100644
index 0000000000..8c205a8247
--- /dev/null
+++ b/lib/dialyzer/test/user_SUITE_data/src/wpc_hlines.erl
@@ -0,0 +1,22 @@
+%% Bug reported by Dan Gudmundsson, test shrunk down by Magnus Lång.
+
+%% The problem is that dialyzer_dep generates edges from the fun
+%% application to both of the functions, and then during the warning pass
+%% dialyzer_dataflow:handle_apply_or_call generates warnings for any such
+%% edge that won't return.
+
+%% Since dialyzer_dep is currently supposed to overapproximate rather than
+%% underapproximate, the fix was to modify handle_apply_or_call to not generate
+%% warnings if some of the possible funs can succeed.
+
+-module(wpc_hlines).
+
+-export([do_export/0]).
+
+do_export() ->
+ {Proj, _} = % The culprit seems to be putting the funs in a tuple
+ {fun good/1, fun bad/1},
+ Proj(true).
+
+good(_) -> ok.
+bad(false) -> ok.