mirror of
https://github.com/ziglang/zig.git
synced 2025-12-13 01:33:09 +00:00
Instead of explicitly setting lhs to .none, check if the lhs instruction was analyzed. This simpler approach also handles stores from nested blocks correctly.
16 lines
243 B
Zig
16 lines
243 B
Zig
const builtin = @import("builtin");
|
|
|
|
fn retOpt() ?u32 {
|
|
return null;
|
|
}
|
|
test {
|
|
var cond = true;
|
|
const opt = while (cond) {
|
|
if (retOpt()) |opt| {
|
|
break opt;
|
|
}
|
|
break 1;
|
|
} else 2;
|
|
_ = opt;
|
|
}
|