← Back to archive

Stdle #148 · comptime · 2026-11-01

What does this Zig snippet output?

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

const std = @import("std");
fn add(a: anytype, b: anytype) @TypeOf(a) {
return a + b;
}
pub fn main() void {
std.debug.print("{d}\n", .{add(@as(i32, 10), @as(i32, 25))});
}
Comptime
4 attempts left

Answer & explanation