Zig Version
0.14.0
Steps to Reproduce and Observed Behavior
Compile the following file:
const std = @import("std");
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
const alloc = gpa.allocator();
defer _ = gpa.deinit();
const ZonType = struct {
comptime field: @TypeOf(.value) = .value,
};
const zon_txt =
\\.{
\\ .field = .value,
\\}
;
const zon_parsed = try std.zon.parse.fromSlice(ZonType, alloc, zon_txt, null, .{});
defer std.zon.parse.free(alloc, zon_parsed);
}
Observed behaviour
Compiler reaches unreachable code in a switch in std.zon.parse.free.
This also happens if I delete the call to std.zon.parse.free.
Expected Behavior
Program compiles with no error.
Parsing a ZON file with enum literals is required to fully read a build.zig.zon file.
(It's still possible to read it partially by using the ignore_unknown_fields option when parsing)
Zig Version
0.14.0
Steps to Reproduce and Observed Behavior
Compile the following file:
Observed behaviour
Compiler reaches unreachable code in a switch in
std.zon.parse.free.This also happens if I delete the call to
std.zon.parse.free.Expected Behavior
Program compiles with no error.
Parsing a ZON file with enum literals is required to fully read a
build.zig.zonfile.(It's still possible to read it partially by using the
ignore_unknown_fieldsoption when parsing)