authorgravatar for kt@connectfree.co.jpkristopher tate <kt@connectfree.co.jp> 2018-07-28 23:52:12+09:00
committergravatar for kt@connectfree.co.jpkristopher tate <kt@connectfree.co.jp> 2018-08-02 16:50:08+09:00
log13ec5db2348a0f6a4464aa8a513dbf11b72dc3ae
tree7754d65bd7b62946044a6ac0e6f398c40119ad43
parentc546f750f14e63b80c01d707c5559524313edfe4

test/compile_errors.zig: @handle() in non-async function

Tracking Issue #1296 ;

1 files changed, 14 insertions(+), 0 deletions(-)

test/compile_errors.zig+14
......@@ -4754,4 +4754,18 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
47544754 ,
47554755 ".tmp_source.zig:6:29: error: @handle() called outside of function definition",
47564756 );
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 );
47574771}