aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer
diff options
context:
space:
mode:
authorStavros Aronis <[email protected]>2011-03-21 18:40:13 +0200
committerHenrik Nord <[email protected]>2011-05-04 15:06:16 +0200
commit1f1e0451e973c379ff402a5ce64c86ea80f110de (patch)
tree2558d7a81367ee26f1960d426f6d209b8d09a8a4 /lib/dialyzer
parent4db4b78d1e8c27774c4d803723f4aa6a5df2009c (diff)
downloadotp-1f1e0451e973c379ff402a5ce64c86ea80f110de.tar.gz
otp-1f1e0451e973c379ff402a5ce64c86ea80f110de.tar.bz2
otp-1f1e0451e973c379ff402a5ce64c86ea80f110de.zip
Add small/false_false
Diffstat (limited to 'lib/dialyzer')
-rw-r--r--lib/dialyzer/test/small_SUITE_data/src/false_false.erl32
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/dialyzer/test/small_SUITE_data/src/false_false.erl b/lib/dialyzer/test/small_SUITE_data/src/false_false.erl
new file mode 100644
index 0000000000..e8efc42868
--- /dev/null
+++ b/lib/dialyzer/test/small_SUITE_data/src/false_false.erl
@@ -0,0 +1,32 @@
+%%----------------------------------------------------------------------------
+%% Mail from user (username: sauron!) via Dan Gudmundsson (17 Dec 2010).
+%%
+%% tried this on:
+%% Erlang R14B (erts-5.8.1.2) [smp:2:2] [rq:2] [async-threads:0] ...
+%% and got funny diagnostics from dialyzer
+%%
+%% false_false.erl:20: Function false_or/0 has no local return
+%% false_false.erl:25: The variable _ can never match since previous
+%% clauses completely covered the type 'ok'
+%%
+%% Problem in the handling of 'or' with constant 'false' arguments
+%% fixed by Stavros Aronis and Maria Christakis on the same day.
+%%----------------------------------------------------------------------------
+-module(false_false).
+
+-export([false_or/0, wips/0]).
+
+false_or() ->
+ false or false.
+
+wips() ->
+ case new_execute_cmd(random:uniform(2)) of
+ ok -> mostly_good;
+ _ -> and_here_we_are
+ end.
+
+new_execute_cmd(1) ->
+ ok;
+new_execute_cmd(2) ->
+ io:format("Surprise result is: ~p~n", [false or false]),
+ false.