Skip to content

std.MultiArrayList errors with a tuple that containing void #25440

@youdie323323

Description

@youdie323323

Zig Version

0.15.1

Steps to Reproduce and Observed Behavior

test {
    const gpa = testing.allocator;

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

    list.append(gpa, .{{}}) catch unreachable;
}

const std = @import("std");
const testing = std.testing;

Testing this code causes the build error:

*\zig\x86_64-windows-0.15.1\lib\std\multi_array_list.zig:625:26: error: extern struct fields cannot be marked comptime
            break :entry @Type(.{ .@"struct" = .{
                         ^~~~~
referenced by:
    dbHelper: *\zig\x86_64-windows-0.15.1\lib\std\multi_array_list.zig:634:71
    comptime: *\zig\x86_64-windows-0.15.1\lib\std\multi_array_list.zig:643:22
    test_1: *\zig\x86_64-windows-0.15.1\lib\std\multi_array_list.zig:21:12

Expected Behavior

MultiArrayList must works with a tuple that containing void.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions