| ... | @@ -316,12 +316,6 @@ fn doInner(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.Val | ... | @@ -316,12 +316,6 @@ fn doInner(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.Val |
| 316 | if (v.raw) { | 316 | if (v.raw) { |
| 317 | if (@hasDecl(opts.Ctx, "pek_" ++ v.name)) @compileError("pek: attempted to call safe custom function: '" ++ v.name ++ "' but did not use '{" ++ v.name ++ "}'"); | 317 | if (@hasDecl(opts.Ctx, "pek_" ++ v.name)) @compileError("pek: attempted to call safe custom function: '" ++ v.name ++ "' but did not use '{" ++ v.name ++ "}'"); |
| 318 | const func = @field(opts.Ctx, "pek__" ++ v.name); | 318 | const func = @field(opts.Ctx, "pek__" ++ v.name); |
| 319 | const Tup = @typeInfo(@TypeOf(func)).@"fn".params[3].type.?; | | |
| 320 | if (@typeInfo(Tup).@"struct".fields.len == 0) { | | |
| 321 | // edge case branch because 'struct {}' is counted as a non-tuple | | |
| 322 | try @call(.auto, func, .{ alloc, writer, opts, Tup{} }); | | |
| 323 | return; | | |
| 324 | } | | |
| 325 | comptime var types: [v.args.len]type = @splat(void); | 319 | comptime var types: [v.args.len]type = @splat(void); |
| 326 | inline for (v.args, &types) |arg, *T| T.* = ResolveArg(arg, @TypeOf(data), @TypeOf(ctx)); | 320 | inline for (v.args, &types) |arg, *T| T.* = ResolveArg(arg, @TypeOf(data), @TypeOf(ctx)); |
| 327 | var args: std.meta.Tuple(&types) = undefined; | 321 | var args: std.meta.Tuple(&types) = undefined; |