diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-12-19 18:21:42 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-12-19 18:21:42 -0500 |
| commit | 1cc450e6e70008eb2eaf62f2992d9d3e8b3ab87a (patch) | |
| tree | 6e7b3c3dc93acb1e70dc5d6d952b185d984b2b97 /test/compile_errors.zig | |
| parent | 1435604b84dbf338c1b6096f473bc89aef144be0 (diff) | |
| download | zig-1cc450e6e70008eb2eaf62f2992d9d3e8b3ab87a.tar.gz zig-1cc450e6e70008eb2eaf62f2992d9d3e8b3ab87a.zip | |
fix assert when wrapping zero bit type in nullable
closes #659
Diffstat (limited to 'test/compile_errors.zig')
| -rw-r--r-- | test/compile_errors.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig index 22520802fb..fb7daea481 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -1,6 +1,16 @@ const tests = @import("tests.zig"); pub fn addCases(cases: &tests.CompileErrorContext) { + cases.add("attempt to use 0 bit type in extern fn", + \\extern fn foo(ptr: extern fn(&void)); + \\ + \\export fn entry() { + \\ foo(bar); + \\} + \\ + \\extern fn bar(x: &void) { } + , ".tmp_source.zig:7:18: error: parameter of type '&void' has 0 bits; not allowed in function with calling convention 'ccc'"); + cases.add("implicit semicolon - block statement", \\export fn entry() { \\ {} |
