diff options
Diffstat (limited to 'src/json.zig')
| -rw-r--r-- | src/json.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/json.zig b/src/json.zig index 9252344..ff07531 100644 --- a/src/json.zig +++ b/src/json.zig | |||
| @@ -50,7 +50,7 @@ pub fn makeJsonParseFromValue(T: type) JsonParseFromValue(T) { | |||
| 50 | 50 | ||
| 51 | pub fn makeJsonParseFromValueWithTag(T: type, comptime tag: [:0]const u8) JsonParseFromValue(T) { | 51 | pub fn makeJsonParseFromValueWithTag(T: type, comptime tag: [:0]const u8) JsonParseFromValue(T) { |
| 52 | const union_info = switch (@typeInfo(T)) { | 52 | const union_info = switch (@typeInfo(T)) { |
| 53 | .Union => |info| blk: { | 53 | .@"union" => |info| blk: { |
| 54 | if (info.tag_type == null) { | 54 | if (info.tag_type == null) { |
| 55 | @compileError("Only tagged unions supported, got '" ++ @typeName(T) ++ "'"); | 55 | @compileError("Only tagged unions supported, got '" ++ @typeName(T) ++ "'"); |
| 56 | } | 56 | } |
| @@ -62,12 +62,12 @@ pub fn makeJsonParseFromValueWithTag(T: type, comptime tag: [:0]const u8) JsonPa | |||
| 62 | const TagType = union_info.tag_type.?; | 62 | const TagType = union_info.tag_type.?; |
| 63 | 63 | ||
| 64 | const Base = blk: { | 64 | const Base = blk: { |
| 65 | const info = std.builtin.Type{ .Struct = .{ | 65 | const info = std.builtin.Type{ .@"struct" = .{ |
| 66 | .layout = .auto, | 66 | .layout = .auto, |
| 67 | .fields = &.{.{ | 67 | .fields = &.{.{ |
| 68 | .name = tag, | 68 | .name = tag, |
| 69 | .type = TagType, | 69 | .type = TagType, |
| 70 | .default_value = null, | 70 | .default_value_ptr = null, |
| 71 | .is_comptime = false, | 71 | .is_comptime = false, |
| 72 | .alignment = 0, | 72 | .alignment = 0, |
| 73 | }}, | 73 | }}, |