← Back to archive

Stdle #84 · comptime · 2026-08-29

What does this Zig snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

const std = @import("std");
fn identity(comptime T: type, val: T) T {
return val;
}
pub fn main() void {
std.debug.print("{d}\n", .{identity(u8, 42)});
}
Comptime
4 attempts left

Answer & explanation