The following code:
decode24(out.slice(), str) catch |err| {
debug("error: {}", .{err});
unreachable;
};
Generates the following compile error:
/usr/lib/zig/std/mem.zig:205:17: error: unable to evaluate comptime expression
dest[i] = s;
~~~~~~~~^~~
/usr/lib/zig/std/mem.zig:205:13: note: operation is runtime due to this operand
dest[i] = s;
~~~~^~~
/usr/lib/zig/std/io/fixed_buffer_stream.zig:70:21: note: called from here
mem.copy(u8, self.buffer[self.pos .. self.pos + n], bytes[0..n]);
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/zig/std/io/writer.zig:17:27: note: called from here
return writeFn(self.context, bytes);
~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/usr/lib/zig/std/io/writer.zig:23:40: note: called from here
index += try self.write(bytes[index..]);
~~~~~~~~~~^~~~~~~~~~~~~~~~
/usr/lib/zig/std/fmt.zig:121:32: note: called from here
try writer.writeAll(fmt[start_index..end_index]);
~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/zig/std/fmt.zig:1954:15: note: called from here
try format(fbs.writer(), fmt, args);
~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/home/kuon/pbg/zkfs-sdk/js/src/common/log.zig:16:31: note: called from here
var buf = std.fmt.bufPrint(&log_buf, format ++ "\r\n", args) catch {
~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/zig/std/log.zig:125:22: note: called from here
std.options.logFn(message_level, scope, format, args);
~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/zig/std/log.zig:203:16: note: called from here
log(.debug, scope, format, args);
~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/client.zig:17:14: note: called from here
debug("error: {}", .{err});
~~~~~^~~~~~~~~~~~~~~~~~~~~
src/client.zig:24:24: note: called from here
Am I doing something wrong or is it a zig bug?