From 1f1e0451e973c379ff402a5ce64c86ea80f110de Mon Sep 17 00:00:00 2001 From: Stavros Aronis Date: Mon, 21 Mar 2011 18:40:13 +0200 Subject: Add small/false_false --- .../test/small_SUITE_data/src/false_false.erl | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 lib/dialyzer/test/small_SUITE_data/src/false_false.erl (limited to 'lib/dialyzer/test/small_SUITE_data/src') 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. -- cgit v1.2.3