diff options
| author | Veikka Tuominen <git@vexu.eu> | 2022-07-26 16:20:38 +0300 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2022-07-29 10:08:35 +0300 |
| commit | 9e0a930ce3be01923602adbfee13b50842da08b7 (patch) | |
| tree | f48fa98efd8c6d75cf431fa3c10e231e3688d0ff /test/cases/compile_errors/comptime_continue_inside_runtime_catch.zig | |
| parent | b5861193e072ba6780730a559f2b879378b8587f (diff) | |
| download | zig-9e0a930ce3be01923602adbfee13b50842da08b7.tar.gz zig-9e0a930ce3be01923602adbfee13b50842da08b7.zip | |
stage2: add error for comptime control flow in runtime block
Diffstat (limited to 'test/cases/compile_errors/comptime_continue_inside_runtime_catch.zig')
| -rw-r--r-- | test/cases/compile_errors/comptime_continue_inside_runtime_catch.zig | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/cases/compile_errors/comptime_continue_inside_runtime_catch.zig b/test/cases/compile_errors/comptime_continue_inside_runtime_catch.zig new file mode 100644 index 0000000000..9e62420f1f --- /dev/null +++ b/test/cases/compile_errors/comptime_continue_inside_runtime_catch.zig @@ -0,0 +1,16 @@ +export fn entry() void { + const ints = [_]u8{ 1, 2 }; + inline for (ints) |_| { + bad() catch continue; + } +} +fn bad() !void { + return error.Bad; +} + +// error +// backend=stage2 +// target=native +// +// :4:21: error: comptime control flow inside runtime block +// :4:15: note: runtime control flow here |
