authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-06-28 23:14:19 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-06-28 23:14:19 -07:00
log562cb52dc2a31bfa9859201aa5d73b5d835bf949
tree933903efc5c79e4c6221476ed53dec3c8d797510
parent70d6284bd93fa0e3c6c2310e5e62f1a36535b6ca

fix ifnotequal when comparing enum to tagname


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

src/lib.zig+1-1
...@@ -176,7 +176,7 @@ inline fn do(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.V...@@ -176,7 +176,7 @@ inline fn do(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.V
176 comptime assertEqual(v.args.len, 2);176 comptime assertEqual(v.args.len, 2);
177 const y = resolveArg(v.args[1], data, ctx);177 const y = resolveArg(v.args[1], data, ctx);
178 if (@typeInfo(@TypeOf(x)) == .Enum and comptime std.meta.trait.isZigString(@TypeOf(y))) {178 if (@typeInfo(@TypeOf(x)) == .Enum and comptime std.meta.trait.isZigString(@TypeOf(y))) {
179 return try doif(alloc, writer, body, bottom, data, ctx, opts, std.mem.eql(u8, @tagName(x), y));179 return try doif(alloc, writer, body, bottom, data, ctx, opts, !std.mem.eql(u8, @tagName(x), y));
180 }180 }
181 try doif(alloc, writer, body, bottom, data, ctx, opts, x != y);181 try doif(alloc, writer, body, bottom, data, ctx, opts, x != y);
182 },182 },