| ... | @@ -4754,4 +4754,18 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { | ... | @@ -4754,4 +4754,18 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4754 | , | 4754 | , |
| 4755 | ".tmp_source.zig:6:29: error: @handle() called outside of function definition", | 4755 | ".tmp_source.zig:6:29: error: @handle() called outside of function definition", |
| 4756 | ); | 4756 | ); |
| | 4757 | |
| | 4758 | cases.add( |
| | 4759 | "@handle() in non-async function", |
| | 4760 | \\pub fn panic(message: []const u8, stack_trace: ?*@import("builtin").StackTrace) noreturn { |
| | 4761 | \\ @import("std").os.exit(126); |
| | 4762 | \\} |
| | 4763 | \\ |
| | 4764 | \\pub fn main() void { |
| | 4765 | \\ var handle_undef: promise = undefined; |
| | 4766 | \\ if (handle_undef == @handle()) return 0; |
| | 4767 | \\} |
| | 4768 | , |
| | 4769 | ".tmp_source.zig:7:25: error: @handle() in non-async function", |
| | 4770 | ); |
| 4757 | } | 4771 | } |