aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/test/opaque_SUITE_data/src/para/para4_adt.erl
blob: 06a6c22677a0dc7d2f7caa27cfd49a4ddf90b662 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
-module(para4_adt).

-export([t1/0, t2/0, t3/0, y1/0, y2/0, y3/0]).

-export([int2/0, int4/0, int2_4/0, int5_7/0]).

-export([un1_2/0, un3_4/0]).

-export([tup/0, tup2/0]).

-export([map/0, map2/0]).

-export_type([t/1, y/1, int/1, tup/1, un/1]).

-type ai() :: atom() | integer().

-opaque t(A) :: {A, A}.

-type y(A) :: {A, A}.

-opaque int(I) :: I.

-opaque un(I) :: atom() | I.

-opaque tup(T) :: T.

-spec t1() -> t(integer()).

t1() ->
    {i(), i()}.

-spec t2() -> t(atom()).

t2() ->
    {a(), a()}.

-spec t3() -> t(ai()).

t3() ->
    {ai(), ai()}.

-spec y1() -> y(integer()).

y1() ->
    {i(), i()}.

-spec y2() -> y(atom()).

y2() ->
    {a(), a()}.

-spec y3() -> y(ai()).

y3() ->
    {ai(), ai()}.

-spec a() -> atom().

a() ->
    foo:a().

-spec i() -> integer().

i() ->
    foo:i().

-spec ai() -> ai().

ai() ->
    foo:ai().

-spec int2() -> int(1..2).

int2() ->
    foo:int2().

-spec int4() -> int(1..4).

int4() ->
    foo:int4().

-spec int2_4() -> int(2..4).

int2_4() ->
    foo:int2_4().

-spec int5_7() -> int(5..7).

int5_7() ->
    foo:int5_7().

-spec un1_2() -> un(1..2).

un1_2() ->
    foo:un1_2().

-spec un3_4() -> un(3..4).

un3_4() ->
    foo:un3_4().

-spec tup() -> tup(tuple()).

tup() ->
    foo:tup().

-spec tup2() -> tup({_, _}).

tup2() ->
    foo:tup2().

-spec map() -> t(#{2 => b}).

map() ->
    foo:map().

-spec map2() -> t(#{1 => a}).

map2() ->
    foo:map2().