Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MathewProkossonos opened this issue Nov 8, 2023 · 1 comment
Closed
Labels
bug Observed behavior contradicts documented or intended behavior

Comments

@MathewProkossonos
Copy link

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.

@MathewProkossonos MathewProkossonos added the bug Observed behavior contradicts documented or intended behavior label Nov 8, 2023
@Vexu
Copy link
Member

Vexu commented Nov 8, 2023

Duplicate of #12963

@Vexu Vexu marked this as a duplicate of #12963 Nov 8, 2023
@Vexu Vexu closed this as not planned Won't fix, can't repro, duplicate, stale Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior
Projects
None yet
Development

No branches or pull requests

2 participants