aboutsummaryrefslogtreecommitdiff
path: root/compiler/tests/parser/expr_exprlists.bad
blob: e331436e775325bdfd3c3ff31c31ac765030d94d (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


int a = ()[int];  // ERROR bad type parameter

/* ERRORS: invalid syntax: comma in empty list */
() b = (,);
(int) c = (,);
(int,int) d = (,);
int#[0] e = [,];
int#[1] f = [,];
int#[2] g = [,];

/* ERRORS: empty expression inside list (not last) */
int#[1] i = [1,,];
int#[2] j = [1,,];
int#[3] k = [1,,];
(int) l = (1,,);
(int,int) m = (1,,);
(int,int,int) n = (1,,);

/* ERRORS: starting with comma */
int#[1] o = [,1];
int#[2] p = [,1];
(int) q = (,1);
(int,int) r = (,1);

/* ERRORS: trailing comma in argument lists */
int ti = arr1#[0,];
int tf = f1args(3,);

int#[1] arr = [123];
int intval = 123;
/* ERRORS: missing array index list */
int noindices1 = e#;
int noindices2 = arr#;
int noindices3 = intval#;

() test() {
    i, j; // ERROR
}