aboutsummaryrefslogtreecommitdiff
path: root/compiler/tests/verifier/expr_typeassert.bad
blob: f8296adeb20d26f53cd27491039b4c24fddd42a8 (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
41
42
43
44

int32 big = 98765;
int8 neg = -1;

/* ERRORS - types */
byte a = big typeassert byte;
count b = neg typeassert count;
uint8 c = neg typeassert uint8;
int8 d = big typeassert int8;
() e = big typeassert ();
int32 f = big typeassert ();
() g = big typeassert int32;

/* ERRORS - parsing */
int p = typeassert;
int q = big typeassert neg;
int r = big typeassert "";
int s = big typeassert;
int t = (big typeassert neg).x;

/* ERRORS - invalid qualifier */
long qual1 = big typeassert var long;
long qual2 = big typeassert const long;
long qual3 = big typeassert shared long;
long qual4 = big typeassert mine long;

() test()
{
    /* ERRORS - types */
    byte a = big typeassert byte;
    count b = neg typeassert count;
    uint8 c = neg typeassert uint8;
    int8 d = big typeassert int8;
    () e = big typeassert ();
    int32 f = big typeassert ();
    () g = big typeassert int32;
    
    /* ERRORS - parsing */
    int p = typeassert;
    int q = big typeassert neg;
    int r = big typeassert "";
    int s = big typeassert;
    int t = (big typeassert neg).x;
}