Confusion about error: unable to resolve comptime value (opens in new tab)
Hi everyone, I am new to Zig and would really some discussion surrounding this issue I am running into to help me learn – thank you! My program: const std = @import(“std”); const print = std.debug.print; pub fn main() void { var count: u32 = 1; count += 1; const a1: [count]u8 = @splat(‘A’); print(“{s}\n”, .{a1}); } Produces this error: error: unable to resolve comptime value const a1: [count]u8 = @splat(‘A’); note: types must be comptime-known I wasn’t expecting this because I specified u32 f...
Read the original article