Trailing:
has_multi_casesany_uses_err_captureinfo.body_len
}has_else
info: ProngInfo,
inst: Index // for every info.body_len
}scalar_cases_len
item: Ref,
info: ProngInfo,
inst: Index // for every info.body_len
}multi_cases_len
items_len: u32,
ranges_len: u32,
info: ProngInfo,
item: Ref // for every items_len
ranges: { // for every ranges_len
item_first: Ref,
item_last: Ref,
}
inst: Index // for every info.body_len
}When analyzing a case body, the switch instruction itself refers to the
captured error, or to the success value in non_err_body. Whether this
is captured by reference or by value depends on whether the byref bit
is set for the corresponding body. err_capture_inst refers to the error
capture outside of the switch, i.e. err in
x catch |err| switch (err) { ... }.
pub const SwitchBlockErrUnion = struct {
operand: Ref,
bits: Bits,
main_src_node_offset: i32,
pub const Bits = packed struct(u32) {
/// If true, one or more prongs have multiple items.
has_multi_cases: bool,
/// If true, there is an else prong. This is mutually exclusive with `has_under`.
has_else: bool,
any_uses_err_capture: bool,
payload_is_ref: bool,
scalar_cases_len: ScalarCasesLen,
pub const ScalarCasesLen = u28;
};
pub const MultiProng = struct {
items: []const Ref,
body: []const Index,
};
}