test "" {
const T = struct {
@"0": u8,
@"1": bool,
};
const x: T = .{ 5, true };
}
// Semantic Analysis [827/1103] ./test.zig:6:21: error: array access of non-array type 'T'
// const x: T = .{ 5, true };
test "" {
const T = @TypeOf(.{ 5, true });
const x: T = .{ 5, true };
}
// Semantic Analysis [826/1102] ./test.zig:3:19: error: type 'struct:2:24' does not support array initialization
// const x: T = .{ 5, true };
test "" {
const T = @TypeOf(.{ 5, true });
const x: T = .{ .@"0" = 5, .@"1" = true };
}
// works