zig/test/behavior/bugs/5487.zig
2021-06-21 17:03:03 -07:00

14 lines
414 B
Zig

const io = @import("std").io;
pub fn write(_: void, bytes: []const u8) !usize {
_ = bytes;
return 0;
}
pub fn writer() io.Writer(void, @typeInfo(@typeInfo(@TypeOf(write)).Fn.return_type.?).ErrorUnion.error_set, write) {
return io.Writer(void, @typeInfo(@typeInfo(@TypeOf(write)).Fn.return_type.?).ErrorUnion.error_set, write){ .context = {} };
}
test "crash" {
_ = io.multiWriter(.{writer()});
}