Nice! This is the same design idea behind std.event.Loop.runDetached: since the async function will not have a surrounding context capable of handling errors, the function you pass in as an argument is required to return void.
/// Runs the provided function asynchronously. The function's frame is allocated/// with `allocator` and freed when the function returns./// `func` must return void and it can be an async function./// Yields to the event loop, running the function on the next tick.pubfnrunDetached(self:*Loop,alloc:mem.Allocator,comptimefunc:anytype,args:anytype)error{OutOfMemory}!void{if(!std.io.is_async)@compileError("Can't use runDetached in non-async mode!");if(@TypeOf(@call(.{},func,args))!=void){@compileError("`func` must not have a return value");}// ...}
For further actions, you may consider blocking this person and/or reporting abuse
Nice! This is the same design idea behind
std.event.Loop.runDetached
: since the async function will not have a surrounding context capable of handling errors, the function you pass in as an argument is required to returnvoid
.github.com/ziglang/zig/blob/master...