diff options
| author | Andrea Orru <andrea@orru.io> | 2018-04-11 00:33:19 -0700 |
|---|---|---|
| committer | Andrea Orru <andrea@orru.io> | 2018-04-11 00:33:19 -0700 |
| commit | 135a335ce12a33666e44cb13e0be4bb893877565 (patch) | |
| tree | 23b10bed3d36e3fb244c6a2e5d5765d8b7a71fb5 /test/compile_errors.zig | |
| parent | b01c5a95c468650f143e0ae96f6c3865852fdcda (diff) | |
| parent | f43711e5fbbedafa1c28c933fdca0949427c77cd (diff) | |
| download | zig-135a335ce12a33666e44cb13e0be4bb893877565.tar.gz zig-135a335ce12a33666e44cb13e0be4bb893877565.zip | |
Merge branch 'master' into zen_stdlib
Diffstat (limited to 'test/compile_errors.zig')
| -rw-r--r-- | test/compile_errors.zig | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig index 68737eee1a..bed5aa1b63 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -1,6 +1,15 @@ const tests = @import("tests.zig"); pub fn addCases(cases: &tests.CompileErrorContext) void { + cases.add("wrong type passed to @panic", + \\export fn entry() void { + \\ var e = error.Foo; + \\ @panic(e); + \\} + , + ".tmp_source.zig:3:12: error: expected type '[]const u8', found 'error{Foo}'"); + + cases.add("@tagName used on union with no associated enum tag", \\const FloatInt = extern union { \\ Float: f32, @@ -17,7 +26,7 @@ pub fn addCases(cases: &tests.CompileErrorContext) void { cases.add("returning error from void async function", \\const std = @import("std"); \\export fn entry() void { - \\ const p = async(std.debug.global_allocator) amain() catch unreachable; + \\ const p = async<std.debug.global_allocator> amain() catch unreachable; \\} \\async fn amain() void { \\ return error.ShouldBeCompileError; |
