zig/test/cases/compile_errors/duplicate-unused_labels.zig
Eric Joldasov 50339f595a all: zig fmt and rename "@XToY" to "@YFromX"
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-19 12:34:42 -07:00

38 lines
757 B
Zig

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)) |_| {}
}
// error
// target=native
//
// :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