Skip to content

Commit

Permalink
Fix: Update enum reflection syntax (#8)
Browse files Browse the repository at this point in the history
* Fix: Update enum reflection syntax

* Update zig version
  • Loading branch information
Tomcat-42 authored Jan 3, 2025
1 parent 4289bf7 commit ead658d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .zigversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.14.0-dev.1911+3bf89f55c
0.14.0-dev.2563+af5e73172
6 changes: 3 additions & 3 deletions src/wrapper.zig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const assert = std.debug.assert;

const meta = struct {
pub fn mergeEnums(comptime Enums: anytype) type {
const tag_type = @typeInfo(Enums[0]).Enum.tag_type;
const tag_type = @typeInfo(Enums[0]).@"enum".tag_type;
const num_fields = countFields: {
var count: comptime_int = 0;
for (Enums) |Subset| {
Expand All @@ -17,15 +17,15 @@ const meta = struct {
comptime var fields: [num_fields]std.builtin.Type.EnumField = .{undefined} ** num_fields;
comptime var i = 0;
for (Enums) |Subset| {
const subset_info = @typeInfo(Subset).Enum;
const subset_info = @typeInfo(Subset).@"enum";
assert(subset_info.tag_type == tag_type);
for (subset_info.fields) |field| {
assert(i < fields.len);
fields[i] = field;
i += 1;
}
}
return @Type(.{ .Enum = .{
return @Type(.{ .@"enum" = .{
.tag_type = tag_type,
.fields = &fields,
.decls = &.{},
Expand Down

0 comments on commit ead658d

Please sign in to comment.