aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/duplicate-unused_labels.zig
blob: 0acc58c9928043a9e98d3e92b632e9df6b8ce693 (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
comptime {
    blk: {
        blk: while (false) {}
    }
}
comptime {
    blk: while (false) {
        blk: for (@as([0]void, undefined)) |_| {}
    }
}
comptime {
    blk: for (@as([0]void, undefined)) |_| {
        blk: {}
    }
}
comptime {
    blk: {}
}
comptime {
    blk: while (false) {}
}
comptime {
    blk: for (@as([0]void, undefined)) |_| {}
}
comptime {
    blk: switch (true) {
        else => {},
    }
}

// error
//
// :3:9: error: redefinition of label 'blk'
// :2:5: note: previous definition here
// :8:9: error: redefinition of label 'blk'
// :7:5: note: previous definition here
// :13:9: error: redefinition of label 'blk'
// :12:5: note: previous definition here
// :17:5: error: unused block label
// :20:5: error: unused while loop label
// :23:5: error: unused for loop label
// :26:5: error: unused switch label