aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/test/opaque_SUITE_data/src/union/union_adt.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2014-01-28 15:38:49 +0100
committerHans Bolinder <[email protected]>2014-01-28 15:38:49 +0100
commita0119e4bff42f3ef38df6c9e8bdd1ba40eb49887 (patch)
tree944b2bb9a333591ff6e4cde694386616407b62f5 /lib/dialyzer/test/opaque_SUITE_data/src/union/union_adt.erl
parent127cd6d32a8f5e3ffd56b13ea8f333eeffa253a2 (diff)
parent7db0bb7ae867ea5de893914a89c51dc0369b5790 (diff)
downloadotp-a0119e4bff42f3ef38df6c9e8bdd1ba40eb49887.tar.gz
otp-a0119e4bff42f3ef38df6c9e8bdd1ba40eb49887.tar.bz2
otp-a0119e4bff42f3ef38df6c9e8bdd1ba40eb49887.zip
Merge branch 'hb/dialyzer/opaque_types_fixes/OTP-10397'
* hb/dialyzer/opaque_types_fixes/OTP-10397: [dialyzer] Re-work the handling of opaque types
Diffstat (limited to 'lib/dialyzer/test/opaque_SUITE_data/src/union/union_adt.erl')
-rw-r--r--lib/dialyzer/test/opaque_SUITE_data/src/union/union_adt.erl9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/dialyzer/test/opaque_SUITE_data/src/union/union_adt.erl b/lib/dialyzer/test/opaque_SUITE_data/src/union/union_adt.erl
index 5ca3202bba..d88f238190 100644
--- a/lib/dialyzer/test/opaque_SUITE_data/src/union/union_adt.erl
+++ b/lib/dialyzer/test/opaque_SUITE_data/src/union/union_adt.erl
@@ -1,10 +1,15 @@
-module(union_adt).
-export([new/1, new_a/1, new_rec/1]).
+%% Now (R17) that opaque types are no longer recognized by their shape
+%% this test case is rather meaningless.
+
-record(rec, {x = 42 :: integer()}).
-opaque u() :: 'aaa' | 'bbb' | #rec{}.
+-spec new(_) -> u().
+
new(a) -> aaa;
new(b) -> bbb;
new(X) when is_integer(X) ->
@@ -13,7 +18,11 @@ new(X) when is_integer(X) ->
%% the following two functions (and their uses in union_use.erl) test
%% that the return type is the opaque one and not just a subtype of it
+-spec new_a(_) -> u().
+
new_a(a) -> aaa.
+-spec new_rec(_) -> u().
+
new_rec(X) when is_integer(X) ->
#rec{x = X}.