commit d5fc826437e16653087d023388f8d6a230a71d68 (tree) parent 1d7e5479b0826776e53b499811198356bc180706 Author: Andrew Kelley <andrew@ziglang.org> Date: Tue, 26 Feb 2019 19:34:22 -0500 add test coverage for binary OR on error sets closes #1074 Diffstat:
| M | test/compile_errors.zig | | | 11 | +++++++++++ |
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/test/compile_errors.zig b/test/compile_errors.zig @@ -2,6 +2,17 @@ const tests = @import("tests.zig"); const builtin = @import("builtin"); pub fn addCases(cases: *tests.CompileErrorContext) void { + cases.addTest( + "binary OR operator on error sets", + \\pub const A = error.A; + \\pub const AB = A | error.B; + \\export fn entry() void { + \\ var x: AB = undefined; + \\} + , + ".tmp_source.zig:2:18: error: invalid operands to binary expression: 'error{A}' and 'error{B}'", + ); + if (builtin.os == builtin.Os.linux) { cases.addTest( "implicit dependency on libc",