diff options
Diffstat (limited to 'test/compile_errors.zig')
| -rw-r--r-- | test/compile_errors.zig | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig index 91916e6f38..12f17ec790 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -3,6 +3,22 @@ const builtin = @import("builtin"); pub fn addCases(cases: *tests.CompileErrorContext) void { cases.add( + "wrong type for result ptr to @asyncCall", + \\export fn entry() void { + \\ _ = async amain(); + \\} + \\fn amain() i32 { + \\ var frame: @Frame(foo) = undefined; + \\ return await @asyncCall(&frame, false, foo); + \\} + \\fn foo() i32 { + \\ return 1234; + \\} + , + "tmp.zig:6:37: error: expected type '*i32', found 'bool'", + ); + + cases.add( "struct depends on itself via optional field", \\const LhsExpr = struct { \\ rhsExpr: ?AstObject, @@ -1051,6 +1067,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { \\const Foo = struct {}; \\export fn a() void { \\ const T = [*c]Foo; + \\ var t: T = undefined; \\} , "tmp.zig:3:19: error: C pointers cannot point to non-C-ABI-compatible type 'Foo'", @@ -2290,6 +2307,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { "error union operator with non error set LHS", \\comptime { \\ const z = i32!i32; + \\ var x: z = undefined; \\} , "tmp.zig:2:15: error: expected error set type, found type 'i32'", |
