mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
sema: inherit block want_safety for err switch union
This commit is contained in:
parent
69ab687156
commit
ec5b751373
@ -11292,6 +11292,7 @@ fn zirSwitchBlockErrUnion(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Comp
|
||||
.runtime_loop = block.runtime_loop,
|
||||
.runtime_index = block.runtime_index,
|
||||
.error_return_trace_index = block.error_return_trace_index,
|
||||
.want_safety = block.want_safety,
|
||||
};
|
||||
const merges = &child_block.label.?.merges;
|
||||
defer child_block.instructions.deinit(gpa);
|
||||
|
||||
@ -23,6 +23,13 @@ pub export fn entry() usize {
|
||||
u += 1;
|
||||
},
|
||||
}
|
||||
if (@as(error{}!usize, u)) |_| {
|
||||
u += 1;
|
||||
} else |e| switch (e) {
|
||||
else => {
|
||||
u += 1;
|
||||
}
|
||||
}
|
||||
return u;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user