1
%%---------------------------------------------------------------------------
2
%% Test that tries some combinations of using more than one opaque data type
3
%% in the same function(s).
4
%%----------------------------------------------------------------------------
5
-module(mixed_opaque_use).
7
-export([ok1/1, ok2/0, wrong1/0]).
9
-define(REC, mixed_opaque_rec_adt).
10
-define(QUEUE, mixed_opaque_queue_adt).
12
%% Currently returning unions of opaque types is considered OK
15
queue -> ?QUEUE:new();
19
%% Constructing a queue of records is OK
23
Q1 = ?QUEUE:add(R0, Q0),
24
{R1,_Q2} = ?QUEUE:dequeue(Q1),
27
%% But of course calling a function expecting some opaque type
28
%% with some other opaque typs is not OK