Skip to content

Anonymous list of arrays fails to build with no error message #17934

Closed as not planned
@MathewProkossonos

Description

@MathewProkossonos

Zig Version

0.11.0

Steps to Reproduce and Observed Behavior

zig pub fn do_something(slice1: []u8, slice2: []u8) void {
    std.debug.print("{any} {any}", .{ slice1, slice2 });
}

pub fn main() !void {
    var anon_list = .{ [_]u8{0} ** 40, [_]u8{0} ** 40 };
    do_something(&anon_list[0], &anon_list[1]);
}

zig build fails with

Build Summary: 0/3 steps succeeded; 1 failed (disable with --summary none) install transitive failure └─ install zcrash transitive failure └─ zig build-exe zcrash Debug native failure error: the following build command failed with exit code 1:

Expected Behavior

This code should compile or give an error indicating the line number of the issue.

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