Skip to content

Incorrect error message when concatting sliced comptime only type #5293

@CurtisFenner

Description

@CurtisFenner

The following program crashes with the given output on my Windows 10 computer:

>zig version
0.6.0

>zig test src/min.zig
Unreachable at D:\a\1\s\src\ir.cpp:28528 in buf_write_value_bytes. This is a bug in the Zig compiler.
Unable to dump stack trace: debug info stripped
const S = struct {};

test "Crashes" {
    const cc = &[_]type{ S, S };
    const init = cc[0..1];
    const dd = init ++ [_]type{S};
}

This is a slightly different error message from what I started with:

Unreachable at D:\a\1\s\src\ir.cpp:28562 in buf_write_value_bytes. This is a bug in the Zig compiler.

That version used a const struct { field: type } instead of type directly, which may or may not be the cause of the difference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behavior

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions