aboutsummaryrefslogtreecommitdiff
path: root/compiler/tests/verifier/type_generic_incomplete.good
blob: 8088141a10ec90c06735ce017570be6ea01ecf98 (plain)
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

typedef incomplete complex[T] = (T r, T i);
complex[float] x; // should be allowed now that complex becomes a complete type
complex[float] y = (1.23, 4.56);
complex[float] z = y;
count size1 = sizeof(x);
count size2 = sizeof(undefined as complex[float]);
float yr = y.r;
float zr = z.r;

complex[complex[float]] nested = ((1.2, 3.4), (5.6, 7.8));
typedef incomplete incompltype1[T] = complex[T];

// These are allowed but point to incomplete types
(complex[private])^ inc1;
(complex[complex[private]])^ inc2;

/* Other useful types */
typedef incomplete interval[T] = (T from, T to);
typedef incomplete point[T] = (T x, T y);
typedef incomplete quat[T] = (T r, T i, T j, T k);
typedef P[T] = (T^ x);

// calandar types would also be nice..
// also (singly,double) linked list etc.
// decimal type? e.g. decimal[+4,+2]
// bignums would be nice but aren't really possible to standardize