favor return over return _ (void return); newline/closing terminates

This commit is contained in:
2026-07-14 19:07:37 +02:00
parent eac5b32738
commit 471896b48a
19 changed files with 92266 additions and 94923 deletions
+14
View File
@@ -266,6 +266,19 @@ stmt_block_escape func() i32 {
return hits # 4 + 1000 (defer) = 1004
}
# A labeled block can also be exited through an ordinary nested block.
stmt_block_nested func() i32 {
hits i32 = 0
outer: {
{
hits = 1
break :outer
}
hits = 100 # skipped by break :outer
}
return hits
}
# Item B: a `none` yielded before a concrete `yield :blk` that references a block local.
lblock_local func() i32 {
r :: blk: {
@@ -319,6 +332,7 @@ main func() i32 {
if (stmt_block(0) != 2) return 132
if (stmt_block_escape() != 1004) return 133
if (lblock_local() != 9) return 134
if (stmt_block_nested() != 1) return 135
return 42
}