diff options
author | Stavros Aronis <[email protected]> | 2012-01-22 17:43:48 +0100 |
---|---|---|
committer | Stavros Aronis <[email protected]> | 2012-02-22 14:13:08 +0100 |
commit | 4ca72667f3e655d175c7587b8998aa7d22f50985 (patch) | |
tree | 307e4372295330fbc3db75fb772ef370bcc85ba9 /lib/dialyzer/test/small_SUITE_data/src | |
parent | 7c3a98b560a80878c603fabe26ca4a572bfe9122 (diff) | |
download | otp-4ca72667f3e655d175c7587b8998aa7d22f50985.tar.gz otp-4ca72667f3e655d175c7587b8998aa7d22f50985.tar.bz2 otp-4ca72667f3e655d175c7587b8998aa7d22f50985.zip |
Zero-arity unused functions Dialyzer patch
Dialyzer was not reporting unused functions with 0 arity. This was not
a real issue, until we found out that there could be cases where this
could lead to false warnings. This was the case in "no_local_return.erl".
Diffstat (limited to 'lib/dialyzer/test/small_SUITE_data/src')
-rw-r--r-- | lib/dialyzer/test/small_SUITE_data/src/no_local_return.erl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/dialyzer/test/small_SUITE_data/src/no_local_return.erl b/lib/dialyzer/test/small_SUITE_data/src/no_local_return.erl new file mode 100644 index 0000000000..4e1a0b015a --- /dev/null +++ b/lib/dialyzer/test/small_SUITE_data/src/no_local_return.erl @@ -0,0 +1,12 @@ +-module(no_local_return). + +%% NOTE: No function is exported. Dialyzer produced a bogus +%% 'Function foo/0 has no local return' warning +%% when in fact typer was finding correct return values for both +%% these functions. + +foo() -> + bar(42). + +bar(X) -> + lists:duplicate(X, gazonk). |