aboutsummaryrefslogtreecommitdiff
path: root/compiler/tests/verifier/type_compatibility_generic.good
blob: 8603aabe34a448f56a7c0430c09f98d6db2f61b8 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40

typedef A[T] = (T^ x);
typedef B[T,U] = (T^ x, U^ y);
typedef C[T] = T^;
typedef D[T] = T^#[2];

int i = 1;
bool b = :false;
(int x) val_x = (1,);
(int x)^ ptr_x = @val_x;
(int^ x) val_a = (@i,);
(int^ x)^ ptr_a = @val_a;

A[int]^ a1 = @(@i,);
A[int]^ a2 = @val_a;
A[int]^ a3 = ptr_a;
A[int]^ a4 = a3;
(int^ x)^ a5 = a4;

B[bool,int] b1 = (@b, @i);
B[bool,int] b2 = b1;

C[int] c1 = @10;

D[int] d1 = [@12,@34];

typedef incomplete X[T] = T;
X[int] xx = 10;

() test()
{
    A[int]^ x = ptr_a;
    A[int] var^ fa1 = a2;
    fa1 = a3;
    any^ axp1 = a3^.x;
    int^ axp2 = a3^.x;
    int axv = a3^.x^;
    
    int testd = d1#[0]^;
}