authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-08-14 14:04:31 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-08-14 14:04:31 -07:00
logde7d6ee282a909fc2a8f6cf845dad53feeee91bd
treea3e6dc947f50d43486886ef22e8e5c749cbff738
parent4f7eb30e4050d1816fff5c39d3411c11a2088494

add better unknown field compile error


1 files changed, 1 insertions(+), 2 deletions(-)

src/lib.zig+1-2
...@@ -177,8 +177,7 @@ fn Field(comptime T: type, comptime field_name: []const u8) type {...@@ -177,8 +177,7 @@ fn Field(comptime T: type, comptime field_name: []const u8) type {
177 if (std.meta.trait.isIndexable(T) and std.mem.eql(u8, field_name, "len")) {177 if (std.meta.trait.isIndexable(T) and std.mem.eql(u8, field_name, "len")) {
178 return usize;178 return usize;
179 }179 }
180 @compileLog(field_name);180 @compileError(std.fmt.comptimePrint("pek: unknown field {s} on type {s}", .{ field_name, @typeName(T) }));
181 @compileLog(std.meta.fieldNames(T));
182}181}
183182
184fn entityLookupBefore(in: []const u8) ?htmlentities.Entity {183fn entityLookupBefore(in: []const u8) ?htmlentities.Entity {