diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-02-26 19:34:22 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-02-26 19:34:22 -0500 |
| commit | d5fc826437e16653087d023388f8d6a230a71d68 (patch) | |
| tree | c8f3db92a4a4d5facf12754976f63e2a27d547dc /test/compile_errors.zig | |
| parent | 1d7e5479b0826776e53b499811198356bc180706 (diff) | |
| download | zig-d5fc826437e16653087d023388f8d6a230a71d68.tar.gz zig-d5fc826437e16653087d023388f8d6a230a71d68.zip | |
add test coverage for binary OR on error sets
closes #1074
Diffstat (limited to 'test/compile_errors.zig')
| -rw-r--r-- | test/compile_errors.zig | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig index 58a7190c67..81e47e171a 100644 --- 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", |
