aboutsummaryrefslogtreecommitdiff
path: root/compiler/tests/verifier/type_compatibility_generic.bad
blob: 28efa6a4d22a76e40147dee3429552710a0f5a1e (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

typedef A[T] = (T^ x);
typedef B[T,U] = (T^ x, U^ y);

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;

/* ERRORS */
A[bool]^ a11 = @(@i,);
A[int,int]^ a12 = @(@i,);
A[bool]^ a21 = @val_a;
A[int,int]^ a22 = @val_a;
A[bool]^ a31 = ptr_a;
A[int,int]^ a32 = ptr_a;
A[bool]^ a41 = a3;
A[int,int]^ a42 = a3;
(int^ x)^ a5 = a4;

/* ERRORS */
B[bool,int] b1 = (@i, @b);
B[bool,bool] b2 = b1;
B[int,int] b3 = b1;
B[bool] b4 = b2;

() test()
{
    /* ERRORS */
    A[bool]^ x = ptr_a;
    A[int] var^ fa1 = a21;
    fa1 = a31;
}