mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
parent
dd437ae399
commit
78a7bb108a
@ -1916,7 +1916,7 @@ pub const Object = struct {
|
||||
|
||||
if (ty.castTag(.@"struct")) |payload| {
|
||||
const struct_obj = payload.data;
|
||||
if (struct_obj.layout == .Packed) {
|
||||
if (struct_obj.layout == .Packed and struct_obj.haveFieldTypes()) {
|
||||
const info = struct_obj.backing_int_ty.intInfo(target);
|
||||
const dwarf_encoding: c_uint = switch (info.signedness) {
|
||||
.signed => DW.ATE.signed,
|
||||
|
||||
@ -109,6 +109,7 @@ test {
|
||||
_ = @import("behavior/bugs/13128.zig");
|
||||
_ = @import("behavior/bugs/13164.zig");
|
||||
_ = @import("behavior/bugs/13171.zig");
|
||||
_ = @import("behavior/bugs/13159.zig");
|
||||
_ = @import("behavior/byteswap.zig");
|
||||
_ = @import("behavior/byval_arg_var.zig");
|
||||
_ = @import("behavior/call.zig");
|
||||
|
||||
14
test/behavior/bugs/13159.zig
Normal file
14
test/behavior/bugs/13159.zig
Normal file
@ -0,0 +1,14 @@
|
||||
const std = @import("std");
|
||||
const expect = std.testing.expect;
|
||||
|
||||
const Bar = packed struct {
|
||||
const Baz = enum {
|
||||
fizz,
|
||||
buzz,
|
||||
};
|
||||
};
|
||||
|
||||
test {
|
||||
var foo = Bar.Baz.fizz;
|
||||
try expect(foo == .fizz);
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user