authorgravatar for sharpobject@gmail.comsharpobject <sharpobject@gmail.com> 2022-02-10 05:57:10+09:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2022-02-13 14:33:17+02:00
log17822e4a050dcbcf7fe324fcdff68887fee73ff1
tree8f9492befb7ea594d8951ff3ecd9d29aca9b6da3
parent0b7347fd18eee7dd829cd9aaed3683123d84859b

std.json: fix compile error for comptime fields

This is covered by an existing test which was already failing.

1 files changed, 1 insertions(+), 1 deletions(-)

lib/std/json.zig+1-1
...@@ -1766,7 +1766,7 @@ fn parseInternal(...@@ -1766,7 +1766,7 @@ fn parseInternal(
1766 }1766 }
1767 }1767 }
1768 if (field.is_comptime) {1768 if (field.is_comptime) {
1769 if (!try parsesTo(field.field_type, field.default_value.?, tokens, child_options)) {1769 if (!try parsesTo(field.field_type, @ptrCast(*const field.field_type, field.default_value.?).*, tokens, child_options)) {
1770 return error.UnexpectedValue;1770 return error.UnexpectedValue;
1771 }1771 }
1772 } else {1772 } else {