compiler: handle switch rewrite review feedback

This commit is contained in:
Matthew Lugg
2026-01-11 14:27:00 +00:00
parent 3a4a7d2ca3
commit 01546e68cd
11 changed files with 128 additions and 115 deletions
+4 -4
View File
@@ -400,12 +400,12 @@ test "breaking from a loop in an if statement" {
_ = opt;
}
test "labeled break from else prong" {
test "labeled break from else" {
const S = struct {
fn doTheTest(x: u32) !void {
var y: u32 = 0;
const ok = label: while (y < x) : (y += 1) {
if (y == 10) break :label false;
const arr: []const u32 = &.{ 1, 3, 10 };
const ok = label: for (arr) |y| {
if (y == x) break :label false;
} else {
break :label true;
};