diff options
author | Hans Bolinder <[email protected]> | 2015-05-05 16:11:12 +0200 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2015-06-15 12:27:40 +0200 |
commit | b109768baf023a0814bda37b452582c7b396ada2 (patch) | |
tree | 5a822f8329876dc2f0bbcf67916256281dd49638 /lib/dialyzer/test/opaque_SUITE_data/src/para/para5.erl | |
parent | dc844097e0828a32b1d53238e3527da1991ed711 (diff) | |
download | otp-b109768baf023a0814bda37b452582c7b396ada2.tar.gz otp-b109768baf023a0814bda37b452582c7b396ada2.tar.bz2 otp-b109768baf023a0814bda37b452582c7b396ada2.zip |
dialyzer: Modify warning for comparison of opaque types
Comparing two operands for (in)equality is allowed if both operands
are of the same unknown opaque type. Since OTP 17, there is a warning
if the types of the operands have nothing in common (this cannot
happen before OTP 17). However, the warning says there is a test
between opaque types, which is wrong. The warning now states that the
comparison cannot evaluate to 'true', which is more consistent.
Diffstat (limited to 'lib/dialyzer/test/opaque_SUITE_data/src/para/para5.erl')
-rw-r--r-- | lib/dialyzer/test/opaque_SUITE_data/src/para/para5.erl | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/dialyzer/test/opaque_SUITE_data/src/para/para5.erl b/lib/dialyzer/test/opaque_SUITE_data/src/para/para5.erl new file mode 100644 index 0000000000..76ea3e76b5 --- /dev/null +++ b/lib/dialyzer/test/opaque_SUITE_data/src/para/para5.erl @@ -0,0 +1,33 @@ +-module(para5). + +-export([d/0, dd/0, da1/0]). + +d() -> + I1 = adt_d1(), + I2 = adt_d2(), + I1 =:= I2. % can never evaluate to true + +dd() -> + I1 = adt_d1(), + I2 = adt_dd(), + I1 =/= I2. % incompatible opaque types + +da1() -> + I1 = adt_da1(), + I2 = adt_da2(), + I1 =:= I2. + +adt_d1() -> + para5_adt:d1(). + +adt_d2() -> + para5_adt:d2(). + +adt_dd() -> + para5_adt:dd(). + +adt_da1() -> + para5_adt:da1(). + +adt_da2() -> + para5_adt:da2(). |