authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-08-14 14:14:49 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-08-14 14:14:49 -07:00
log72a83bf2a6767a7c87d74b26fc0b411cf86baee6
tree53e5955d8e137c2ba7b3d37316d7b8f2484cbd21
parent9e04713bcdbd77b837c80867fde78b9a898f9a27

add compile error for using an unusable type in a if and ifnot block


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

src/lib.zig+2
......@@ -109,6 +109,7 @@ fn do(alloc: *std.mem.Allocator, writer: anytype, comptime value: astgen.Value,
109109 switch (comptime TI) {
110110 .Bool => try doif(alloc, writer, body, bottom, data, ctx, indent, flag1, x),
111111 .Optional => try docap(alloc, writer, body, bottom, data, ctx, indent, flag1, x),
112 else => @compileError(comptime std.fmt.comptimePrint("pek: unable to use '{s}' in an #if block", .{@typeName(T)})),
112113 }
113114 },
114115 .ifnot => {
......@@ -116,6 +117,7 @@ fn do(alloc: *std.mem.Allocator, writer: anytype, comptime value: astgen.Value,
116117 switch (comptime TI) {
117118 .Bool => try doif(alloc, writer, body, bottom, data, ctx, indent, flag1, !x),
118119 .Optional => try docap(alloc, writer, body, bottom, data, ctx, indent, flag1, !x),
120 else => @compileError(comptime std.fmt.comptimePrint("pek: unable to use '{s}' in an #ifnot block", .{@typeName(T)})),
119121 }
120122 },
121123 .ifequal => {