Skip to content

stage2 segfaults when constructing an enum type with an integer given by @Type #12272

@tauoverpi

Description

@tauoverpi

Zig Version

0.10.0-dev.3361+c650ccfca

Steps to Reproduce

Run the following with zig test -fno-stage1

test {
    const Int = @Type(.{ .Int = .{
        .signedness = .unsigned,
        .bits = 12,
    } });
    _ = enum(Int) { empty };
}

Expected Behavior

Compiles without errors.

Actual Behavior

Crashes the compiler.

$ zig test -fno-stage1 bug.zig
fish: Job 1, 'zig test -fno-stage1 bug.zig' terminated by signal SIGSEGV (Address boundary error)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions