diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-03-27 15:07:45 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-03-27 15:07:45 -0400 |
| commit | 6cb99fdac3fb02d7e4e5a363295bae0dd3641a45 (patch) | |
| tree | 596dc91fb9208a0507dfb326198756037232906e /test/compile_errors.zig | |
| parent | 0b7b3190fd1121aa4e349740cff1faf213c94411 (diff) | |
| download | zig-6cb99fdac3fb02d7e4e5a363295bae0dd3641a45.tar.gz zig-6cb99fdac3fb02d7e4e5a363295bae0dd3641a45.zip | |
fix crash when compile error in analyzing @panic call
Diffstat (limited to 'test/compile_errors.zig')
| -rw-r--r-- | test/compile_errors.zig | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig index ddf5286335..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, |
