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

switching on type causes compiler segfault when capture group is included #604

Perelandric opened this Issue Nov 9, 2017 · 0 comments


None yet
2 participants

Perelandric commented Nov 9, 2017

In the following reduced example, the switch on T causes a compiler segmentation fault when the |x| capture group is present.

pub fn main() -> %void {

fn Test(comptime T: type) -> %void {
    const x = switch (T) {
        []u8 => |x| 123,
        i32  => |x| 456,
        else => unreachable,

zig build-exe main.zig
Segmentation fault

Release build:

zig version

@andrewrk andrewrk added the bug label Nov 9, 2017

@andrewrk andrewrk added this to the 0.2.0 milestone Nov 9, 2017

@andrewrk andrewrk modified the milestones: 0.2.0, 0.3.0 Mar 15, 2018

@andrewrk andrewrk closed this in b65cca3 Aug 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment