Zig Version
0.16.0-dev.1399+7b325e08c
Steps to Reproduce and Observed Behavior
/home/yfr/.local/share/mise/installs/zig/master/lib/std/Io.zig:1041:17: error: error union is ignored
@call(.auto, function, args_casted.*);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/yfr/.local/share/mise/installs/zig/master/lib/std/Io.zig:1041:17: note: consider using 'try', 'catch', or 'if'
The line which the error refers to:
|
@call(.auto, function, args_casted.*); |
Expected Behavior
zig should be able to compile the standard library
Simple fix
When the error union should be given back to the caller then this would be a possible fix:
pub fn async(g: *Group, io: Io, function: anytype, args: std.meta.ArgsTuple(@TypeOf(function))) !void {
const Args = @TypeOf(args);
const TypeErased = struct {
fn start(group: *Group, context: *const anyopaque) void {
_ = group;
const args_casted: *const Args = @ptrCast(@alignCast(context));
try @call(.auto, function, args_casted.*);
}
};
io.vtable.groupAsync(io.userdata, g, @ptrCast(&args), .of(Args), TypeErased.start);
}
Zig Version
0.16.0-dev.1399+7b325e08c
Steps to Reproduce and Observed Behavior
The line which the error refers to:
zig/lib/std/Io.zig
Line 1041 in 7b325e0
Expected Behavior
zig should be able to compile the standard library
Simple fix
When the error union should be given back to the caller then this would be a possible fix: