diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-12-08 12:27:02 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-12-08 12:27:02 -0500 |
| commit | d57370d3ca28db17a183157b0497c0ab25e22c19 (patch) | |
| tree | 0dfbe27beb71eabdce5add8e423f5ad5d50f8b09 /test/compile_errors.zig | |
| parent | 19c1b5a33a21bdddfbbca3c65b1c0e6419c4629f (diff) | |
| parent | 64d700bfa6cea1d9a440a7431ec8d64964cdd6c1 (diff) | |
| download | zig-d57370d3ca28db17a183157b0497c0ab25e22c19.tar.gz zig-d57370d3ca28db17a183157b0497c0ab25e22c19.zip | |
Merge branch 'comptime-fields'
closes #3677
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 13e666f49e..3cdf8723ac 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -2,6 +2,15 @@ const tests = @import("tests.zig"); const builtin = @import("builtin"); pub fn addCases(cases: *tests.CompileErrorContext) void { + cases.add("comptime struct field, no init value", + \\const Foo = struct { + \\ comptime b: i32, + \\}; + \\export fn entry() void { + \\ var f: Foo = undefined; + \\} + , "tmp.zig:2:5: error: comptime struct field missing initialization value"); + cases.add( "bad usage of @call", \\export fn entry1() void { @@ -32,7 +41,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { "tmp.zig:15:43: error: unable to evaluate constant expression", ); - cases.add( + cases.add("exported async function", \\export async fn foo() void {} , "tmp.zig:1:1: error: exported function cannot be async"); |
