diff --git a/src/lib.zig b/src/lib.zig index a95a219eddd488b8576dd453efc0f98602018322..835e1c64f882286c92b1a02b9edb6f1a9dfb4ec1 100644 --- a/src/lib.zig +++ b/src/lib.zig @@ -170,6 +170,9 @@ inline fn do(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.V if (@typeInfo(@TypeOf(x)) == .Enum and comptime std.meta.trait.isZigString(@TypeOf(y))) { return try doif(alloc, writer, body, bottom, data, ctx, opts, std.mem.eql(u8, @tagName(x), y)); } + if (comptime std.meta.trait.isSlice(@TypeOf(x, y))) { + return try doif(alloc, writer, body, bottom, data, ctx, opts, std.mem.eql(u8, x, y)); + } try doif(alloc, writer, body, bottom, data, ctx, opts, x == y); }, .ifnotequal => { @@ -178,6 +181,9 @@ inline fn do(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.V if (@typeInfo(@TypeOf(x)) == .Enum and comptime std.meta.trait.isZigString(@TypeOf(y))) { return try doif(alloc, writer, body, bottom, data, ctx, opts, !std.mem.eql(u8, @tagName(x), y)); } + if (comptime std.meta.trait.isSlice(@TypeOf(x, y))) { + return try doif(alloc, writer, body, bottom, data, ctx, opts, !std.mem.eql(u8, x, y)); + } try doif(alloc, writer, body, bottom, data, ctx, opts, x != y); }, }