zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 17822e4a050dcbcf7fe324fcdff68887fee73ff1 (tree)
parent 0b7347fd18eee7dd829cd9aaed3683123d84859b
Author: sharpobject <sharpobject@gmail.com>
Date:   Thu, 10 Feb 2022 05:57:10 +0900

std.json: fix compile error for comptime fields

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

Diffstat:
Mlib/std/json.zig | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/std/json.zig b/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 {