diff options
author | Stavros Aronis <[email protected]> | 2011-10-04 17:18:23 +0200 |
---|---|---|
committer | Stavros Aronis <[email protected]> | 2011-10-14 19:20:51 +0300 |
commit | 33f6f1376a1b2c1109997fd324e3a6072929d950 (patch) | |
tree | d4f6f99634d9ff8575ff2dca0e1661ea452fe87b /lib/dialyzer/test/small_SUITE_data/src/higher_order_discrepancy.erl | |
parent | 7892a31a03505e793a96a9956f0df14c7e14efb5 (diff) | |
download | otp-33f6f1376a1b2c1109997fd324e3a6072929d950.tar.gz otp-33f6f1376a1b2c1109997fd324e3a6072929d950.tar.bz2 otp-33f6f1376a1b2c1109997fd324e3a6072929d950.zip |
Fix false warning about closure application
Whenever a variable that could hold one of two or more possible closures was
used in a particular application, the application was assumed to fail if ONE of
the closures would fail in this application. This has been corrected to infer
failing application if ALL possible closures would fail in the particular
application.
Diffstat (limited to 'lib/dialyzer/test/small_SUITE_data/src/higher_order_discrepancy.erl')
-rw-r--r-- | lib/dialyzer/test/small_SUITE_data/src/higher_order_discrepancy.erl | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/dialyzer/test/small_SUITE_data/src/higher_order_discrepancy.erl b/lib/dialyzer/test/small_SUITE_data/src/higher_order_discrepancy.erl new file mode 100644 index 0000000000..ff5ee6bac4 --- /dev/null +++ b/lib/dialyzer/test/small_SUITE_data/src/higher_order_discrepancy.erl @@ -0,0 +1,14 @@ +-module(higher_order_discrepancy). + +-export([test/1]). + +test(X) -> + F = + case X of + 1 -> fun f/1; + 2 -> fun g/1 + end, + F(foo). + +f(foo) -> ok. +g(bar) -> ok. |