mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 12:59:04 +00:00
parent
581df942e1
commit
ede3798485
@ -15966,8 +15966,8 @@ fn zirStructInit(
|
||||
const first_item = sema.code.extraData(Zir.Inst.StructInit.Item, extra.end).data;
|
||||
const first_field_type_data = zir_datas[first_item.field_type].pl_node;
|
||||
const first_field_type_extra = sema.code.extraData(Zir.Inst.FieldType, first_field_type_data.payload_index).data;
|
||||
const unresolved_struct_type = try sema.resolveType(block, src, first_field_type_extra.container_type);
|
||||
const resolved_ty = try sema.resolveTypeFields(block, src, unresolved_struct_type);
|
||||
const resolved_ty = try sema.resolveType(block, src, first_field_type_extra.container_type);
|
||||
try sema.resolveTypeLayout(block, src, resolved_ty);
|
||||
|
||||
if (resolved_ty.zigTypeTag() == .Struct) {
|
||||
// This logic must be synchronized with that in `zirStructInitEmpty`.
|
||||
|
||||
@ -93,6 +93,7 @@ test {
|
||||
_ = @import("behavior/bugs/12794.zig");
|
||||
_ = @import("behavior/bugs/12801-1.zig");
|
||||
_ = @import("behavior/bugs/12801-2.zig");
|
||||
_ = @import("behavior/bugs/12911.zig");
|
||||
_ = @import("behavior/bugs/12928.zig");
|
||||
_ = @import("behavior/byteswap.zig");
|
||||
_ = @import("behavior/byval_arg_var.zig");
|
||||
|
||||
11
test/behavior/bugs/12911.zig
Normal file
11
test/behavior/bugs/12911.zig
Normal file
@ -0,0 +1,11 @@
|
||||
const builtin = @import("builtin");
|
||||
|
||||
const Item = struct { field: u8 };
|
||||
const Thing = struct {
|
||||
array: [1]Item,
|
||||
};
|
||||
test {
|
||||
if (builtin.zig_backend == .stage1) return error.SkipZigTest;
|
||||
|
||||
_ = Thing{ .array = undefined };
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user