diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-09-13 13:48:41 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-09-13 13:48:41 -0400 |
| commit | ac0cda8df81d5dc7d782ad8a32c0e5b064dd24ec (patch) | |
| tree | d0eef967a9851bb83b8043ad6bb73dbb46ed8a00 /test/compile_errors.zig | |
| parent | 22e39e1e5ab42c2c3d33eeb6797f5835b2004fe3 (diff) | |
| download | zig-ac0cda8df81d5dc7d782ad8a32c0e5b064dd24ec.tar.gz zig-ac0cda8df81d5dc7d782ad8a32c0e5b064dd24ec.zip | |
add compile error for merging non- error sets
closes #1509
Diffstat (limited to 'test/compile_errors.zig')
| -rw-r--r-- | test/compile_errors.zig | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig index dda45a5897..8fb64e21e2 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -2,6 +2,19 @@ const tests = @import("tests.zig"); pub fn addCases(cases: *tests.CompileErrorContext) void { cases.add( + "non error sets used in merge error sets operator", + \\export fn foo() void { + \\ const Errors = u8 || u16; + \\} + \\export fn bar() void { + \\ const Errors = error{} || u16; + \\} + , + ".tmp_source.zig:2:20: error: expected error set type, found 'u8'", + ".tmp_source.zig:5:31: error: expected error set type, found 'u16'", + ); + + cases.add( "variable initialization compile error then referenced", \\fn Undeclared() type { \\ return T; |
