std.json: fix compile error for comptime fields

This is covered by an existing test which was already failing.
This commit is contained in:
sharpobject 2022-02-10 05:57:10 +09:00 committed by Veikka Tuominen
parent 0b7347fd18
commit 17822e4a05

View File

@ -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 {