#How do i make function accept a tuple type as the argument type?
1 messages · Page 1 of 1 (latest)
i dont care what the T and U are
so any tuple?
yeah
I think you might have to use anytype then because its any type in the tuple
what's your usecase
pub fn CompileError(comptime message: []const u8, args: anytype) error{COMPILEERROR}
{
std.debug.print("[SYNTAX ERROR]: " ++ message ++ "\n",args);
return error.COMPILEERROR;
}
i apparently used this function wrong somewhere
but the compiler wont tell me
and instead will tell me that the fmt function needs a tuple (duh)
-freference-trace
any way to print the call stack
how do i use that?
it doesnt work with zig build
where do i put it in my build.zig
It might be called something else
I remember using -freference-trace with zig build so I'm not sure
I think that you can specify the member like args{.@"0"} since tuple members don't have names
Don't take this seriously, I haven't woken up yet
-freference-trace is unfortunately broken on 0.11, you need to upgrade to 0.12.0 master for good traces
you can pass it when using zig build, i.e. zig build run -freference-trace
it should