Commit f776e70c39
Changed files (2)
src
codegen
test
behavior
src/codegen/llvm.zig
@@ -3775,6 +3775,7 @@ pub const Object = struct {
.float,
.enum_tag,
=> {},
+ .opt => {}, // pointer like optional expected
else => unreachable,
}
const bits = ty.bitSize(mod);
test/behavior/packed-struct.zig
@@ -1304,3 +1304,10 @@ test "2-byte packed struct argument in C calling convention" {
try S.bar(s);
}
}
+
+test "packed struct contains optional pointer" {
+ const foo: packed struct {
+ a: ?*@This() = null,
+ } = .{};
+ try expect(foo.a == null);
+}