Commit 17822e4a05

sharpobject <sharpobject@gmail.com>
2022-02-09 21:57:10
std.json: fix compile error for comptime fields
This is covered by an existing test which was already failing.
1 parent 0b7347f
Changed files (1)
lib
lib/std/json.zig
@@ -1766,7 +1766,7 @@ fn parseInternal(
                                     }
                                 }
                                 if (field.is_comptime) {
-                                    if (!try parsesTo(field.field_type, field.default_value.?, tokens, child_options)) {
+                                    if (!try parsesTo(field.field_type, @ptrCast(*const field.field_type, field.default_value.?).*, tokens, child_options)) {
                                         return error.UnexpectedValue;
                                     }
                                 } else {