diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-03-23 19:33:00 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-03-23 19:33:00 -0400 |
| commit | 64dddd7afe14a683826b03bc36ab80fa93a84e2c (patch) | |
| tree | 1c8770889f7ce5cec39f193a5899eaf3a044df0b /test/runtime_safety.zig | |
| parent | 6a9c32f7597d37592d79afa27441e7caf9a30529 (diff) | |
| download | zig-64dddd7afe14a683826b03bc36ab80fa93a84e2c.tar.gz zig-64dddd7afe14a683826b03bc36ab80fa93a84e2c.zip | |
add compile error for ignoring error
closes #772
Diffstat (limited to 'test/runtime_safety.zig')
| -rw-r--r-- | test/runtime_safety.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/runtime_safety.zig b/test/runtime_safety.zig index 0427efabd5..2d153ccff0 100644 --- a/test/runtime_safety.zig +++ b/test/runtime_safety.zig @@ -370,7 +370,7 @@ pub fn addCases(cases: *tests.CompareOutputContext) void { \\ @import("std").os.exit(126); \\} \\pub fn main() void { - \\ _ = bar(9999); + \\ bar(9999) catch {}; \\} \\fn bar(x: u16) anyerror { \\ return @intToError(x); @@ -384,7 +384,7 @@ pub fn addCases(cases: *tests.CompareOutputContext) void { \\const Set1 = error{A, B}; \\const Set2 = error{A, C}; \\pub fn main() void { - \\ _ = foo(Set1.B); + \\ foo(Set1.B) catch {}; \\} \\fn foo(set1: Set1) Set2 { \\ return @errSetCast(Set2, set1); |
