Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion lib/std/multi_array_list.zig
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ pub fn MultiArrayList(comptime T: type) type {
.name = fields[i].name ++ "_ptr",
.type = *fields[i].type,
.default_value_ptr = null,
.is_comptime = fields[i].is_comptime,
.is_comptime = false,
.alignment = fields[i].alignment,
};
break :entry @Type(.{ .@"struct" = .{
Expand Down Expand Up @@ -1082,3 +1082,18 @@ test "orderedRemoveMany" {
list.orderedRemoveMany(&.{0});
try testing.expectEqualSlices(usize, &.{}, list.items(.x));
}

test "value as a tuple that containing comptime field" {
const gpa = testing.allocator;

// Void default to comptime void = {}

var list: MultiArrayList(struct { void }) = .empty;
defer list.deinit(gpa);

try list.append(gpa, .{});

try testing.expectEqual(list.pop().?[0], {});

try testing.expectEqual(list.pop(), null);
}