AstGen: ensure lableld block implicitly ends in a break

This commit is contained in:
Veikka Tuominen
2022-03-09 17:12:40 +02:00
parent bb1fa0bdbd
commit 01b454f851
2 changed files with 10 additions and 0 deletions

View File

@@ -846,3 +846,10 @@ test "discarding the result of various expressions" {
_ = while (S.bar()) |some| break some else {};
_ = for ("foo") |char| break char else {};
}
test "labeled block implicitly ends in a break" {
var a = false;
blk: {
if (a) break :blk;
}
}