anytype Parameters
Accept any argument with duck typing.
Accept Anything with anytype
Sometimes you do not want to name the type at all. Declare a parameter as anytype and Zig infers its type from the argument. 🦆
fn show(x: anytype) void {}Type Is Inferred at the Call
With anytype there is no leading type parameter. Each caller's argument decides the concrete type for that specialization.
show(42);
show(true);