zig/test
Cody Tapscott 0c3a50fe1c stage2: Do not pop error trace if result is an error
This allows for errors to be "re-thrown" by yielding any error as the
result of a catch block. For example:

```zig
fn errorable() !void {
    return error.FallingOutOfPlane;
}

fn foo(have_parachute: bool) !void {
    return errorable() catch |err| b: {
        if (have_parachute) {
            // error trace will include the call to errorable()
            break :b error.NoParachute;
        } else {
            return;
        }
    };
}

pub fn main() !void {
    // Anything that returns a non-error does not pollute the error trace.
    try foo(true);

    // This error trace will still include errorable(), whose error was "re-thrown" by foo()
    try foo(false);
}
```

This is piece (2/3) of https://github.com/ziglang/zig/issues/1923#issuecomment-1218495574
2022-10-21 10:44:19 -07:00
..
behavior Merge pull request #13219 from Vexu/stage2-fixes 2022-10-21 12:11:49 +02:00
c_abi make C ABI tests compile on arm, mips and riscv 2022-10-20 20:11:12 +03:00
cases delete failing recursive test 2022-10-20 20:11:12 +03:00
link test/link: remove redundant dependOn statements 2022-10-18 17:20:08 +02:00
src
stage2 Sema: allow runtime only instructions to be emitted in outside functions 2022-10-20 20:11:00 +03:00
standalone Module: fix early exit conditions during compilation 2022-10-15 14:18:35 -04:00
assemble_and_link.zig
behavior.zig Sema: add missing calls to wip_captures.finalize 2022-10-20 20:11:12 +03:00
cases.zig re-enable nvptx tests 2022-10-15 10:39:19 -07:00
cli.zig Compilation: strip debug info from ReleaseSmall by default 2022-10-11 17:51:25 +02:00
compare_output.zig validate number literals in AstGen 2022-09-13 20:26:04 -04:00
compile_errors.zig fix(text): hyphenate "comptime" adjectives 2022-10-05 21:19:30 +02:00
gen_h.zig
link.zig Sema: implement linksection on functions 2022-10-18 14:02:10 +03:00
run_translated_c.zig translate-c: Fix #12263 2022-10-10 22:29:56 +02:00
stack_traces.zig stage2: Do not pop error trace if result is an error 2022-10-21 10:44:19 -07:00
standalone.zig Module: fix early exit conditions during compilation 2022-10-15 14:18:35 -04:00
tests.zig Sema: implement linksection on functions 2022-10-18 14:02:10 +03:00
translate_c.zig Update translate-c tests 2022-10-11 00:43:53 +02:00