diff options
author | Gustav Simonsson <[email protected]> | 2012-03-27 11:33:40 +0200 |
---|---|---|
committer | Gustav Simonsson <[email protected]> | 2012-03-27 11:33:40 +0200 |
commit | 83f2fac3765d75ab46bc3871c2ac9a53d683edeb (patch) | |
tree | 05450ca5452905ffe2be08b2bc937e21e146b483 /lib/dialyzer/test | |
parent | 3e922e3a1995f7a63d7bf457a6a45a3d8010756f (diff) | |
parent | 982d6706df475dc28535d0fe7922573c618bbc36 (diff) | |
download | otp-83f2fac3765d75ab46bc3871c2ac9a53d683edeb.tar.gz otp-83f2fac3765d75ab46bc3871c2ac9a53d683edeb.tar.bz2 otp-83f2fac3765d75ab46bc3871c2ac9a53d683edeb.zip |
Merge branch 'sa/dialyzer-R15B01-last-minute-fixes' into maint
* sa/dialyzer-R15B01-last-minute-fixes:
Fix bug related with infinitely looping functions
Report only actual unknown types otherwise no message is sent
Use wx:wx_object() type now that it is exported
Up version
Add warnings_as_errors option
Diffstat (limited to 'lib/dialyzer/test')
-rw-r--r-- | lib/dialyzer/test/small_SUITE_data/src/maybe_servers.erl | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/dialyzer/test/small_SUITE_data/src/maybe_servers.erl b/lib/dialyzer/test/small_SUITE_data/src/maybe_servers.erl new file mode 100644 index 0000000000..237f43b1a6 --- /dev/null +++ b/lib/dialyzer/test/small_SUITE_data/src/maybe_servers.erl @@ -0,0 +1,31 @@ +-module(maybe_servers). + +-export([maybe_server/2, mirror_maybe_server/2]). + +maybe_server(O, I) -> + case O of + no -> + maybe_loop(fun(_) -> fin end, I); + yes -> + maybe_loop(fun(X) -> {ok, X} end, I) + end. + +maybe_loop(F, X)-> + case F(X) of + {ok, Y} -> maybe_loop(F, Y); + fin -> exit(n) + end. + +mirror_maybe_loop(F, X)-> + case F(X) of + {ok, Y} -> mirror_maybe_loop(F, Y); + fin -> exit(n) + end. + +mirror_maybe_server(O, I) -> + case O of + no -> + mirror_maybe_loop(fun(_) -> fin end, I); + yes -> + mirror_maybe_loop(fun(X) -> {ok, X} end, I) + end. |