aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/test/small_SUITE_data/src
diff options
context:
space:
mode:
authorStavros Aronis <[email protected]>2012-01-22 17:43:48 +0100
committerStavros Aronis <[email protected]>2012-02-22 14:13:08 +0100
commit4ca72667f3e655d175c7587b8998aa7d22f50985 (patch)
tree307e4372295330fbc3db75fb772ef370bcc85ba9 /lib/dialyzer/test/small_SUITE_data/src
parent7c3a98b560a80878c603fabe26ca4a572bfe9122 (diff)
downloadotp-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.erl12
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).