aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/declaration_between_fields.zig
blob: 4c296f9080ad267fa60ab3a8000aa6764cb7feb2 (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
const S = struct {
    const foo = 2;
    const bar = 2;
    const baz = 2;
    a: struct {
        a: u32,
        b: u32,
    },
    const foo1 = 2;
    const bar1 = 2;
    const baz1 = 2;
    b: usize,
};
comptime {
    _ = S;
}

// error
// backend=stage2
// target=native
//
// :9:5: error: declarations are not allowed between container fields
// :5:5: note: field before declarations here
// :12:5: note: field after declarations here