Skip to content

Segmentation fault compiling switch on union(enum(comptime_int)) with multiple fields #17570

@amp-59

Description

@amp-59

Zig Version

0.12.0-dev.983+78f2ae7f2

Steps to Reproduce and Observed Behavior

Compile example program with zig build-obj union_enum_comptime_int.zig
union_enum_comptime_int.zig:

const Tag = union(enum(comptime_int)) { a, b };

export fn entry(payload: Tag) void {
    switch (payload) {
        else => {},
    }
}

Actual result:

zig build-obj union_enum_comptime_int.zig
Segmentation fault

Expected Behavior

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

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions