pub fn new(err: Errors, span: Span, meta: anytype) NeoError {
const meta_info = @typeInfo(@TypeOf(meta)).Struct;
const fields = meta_info.fields;
var slice = allocator.alloc([2][]const u8, fields.len) catch unreachable;
comptime var i = 0;
inline for (fields) |field| {
slice[i] = .{ field.name, @field(meta, field.name) };
i += 1;
}
const _meta = std.StaticStringMap([]const u8).init(slice, allocator);
return NeoError{ .err = err, .span = span, .meta = _meta };
}
i already tested slice, returning all correctly:
{ { character, ~ } }
Where is the issue?