mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
parent
de24cea2cf
commit
930f904aaa
@ -17406,7 +17406,7 @@ fn reifyStruct(
|
||||
if (!try sema.intFitsInType(block, src, alignment_val, Type.u32, null)) {
|
||||
return sema.fail(block, src, "alignment must fit in 'u32'", .{});
|
||||
}
|
||||
const abi_align = @intCast(u29, alignment_val.toUnsignedInt(target));
|
||||
const abi_align = @intCast(u29, (try alignment_val.getUnsignedIntAdvanced(target, sema.kit(block, src))).?);
|
||||
|
||||
const field_name = try name_val.toAllocatedBytes(
|
||||
Type.initTag(.const_slice_u8),
|
||||
|
||||
@ -87,6 +87,7 @@ test {
|
||||
_ = @import("behavior/bugs/12486.zig");
|
||||
_ = @import("behavior/bugs/12680.zig");
|
||||
_ = @import("behavior/bugs/12776.zig");
|
||||
_ = @import("behavior/bugs/12786.zig");
|
||||
_ = @import("behavior/bugs/12794.zig");
|
||||
_ = @import("behavior/byteswap.zig");
|
||||
_ = @import("behavior/byval_arg_var.zig");
|
||||
|
||||
28
test/behavior/bugs/12786.zig
Normal file
28
test/behavior/bugs/12786.zig
Normal file
@ -0,0 +1,28 @@
|
||||
const std = @import("std");
|
||||
|
||||
fn NamespacedGlobals(comptime modules: anytype) type {
|
||||
return @Type(.{
|
||||
.Struct = .{
|
||||
.layout = .Auto,
|
||||
.is_tuple = false,
|
||||
.fields = &.{
|
||||
.{
|
||||
.name = "globals",
|
||||
.field_type = modules.mach.globals,
|
||||
.default_value = null,
|
||||
.is_comptime = false,
|
||||
.alignment = @alignOf(modules.mach.globals),
|
||||
},
|
||||
},
|
||||
.decls = &[_]std.builtin.Type.Declaration{},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
test {
|
||||
_ = NamespacedGlobals(.{
|
||||
.mach = .{
|
||||
.globals = struct {},
|
||||
},
|
||||
});
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user