authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-02-26 19:34:22-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-02-26 19:34:22-05:00
logd5fc826437e16653087d023388f8d6a230a71d68
treec8f3db92a4a4d5facf12754976f63e2a27d547dc
parent1d7e5479b0826776e53b499811198356bc180706
signaturelock-open Commit is signed but in an unrecognized format.

add test coverage for binary OR on error sets

closes #1074

1 files changed, 11 insertions(+), 0 deletions(-)

test/compile_errors.zig+11
......@@ -2,6 +2,17 @@ const tests = @import("tests.zig");
22const builtin = @import("builtin");
33
44pub fn addCases(cases: *tests.CompileErrorContext) void {
5 cases.addTest(
6 "binary OR operator on error sets",
7 \\pub const A = error.A;
8 \\pub const AB = A | error.B;
9 \\export fn entry() void {
10 \\ var x: AB = undefined;
11 \\}
12 ,
13 ".tmp_source.zig:2:18: error: invalid operands to binary expression: 'error{A}' and 'error{B}'",
14 );
15
516 if (builtin.os == builtin.Os.linux) {
617 cases.addTest(
718 "implicit dependency on libc",