Zig Version

0.10.0-dev.4212+34835bbbc

Steps to Reproduce

fn function(byte: u8) void {
    switch (byte) {
        byte => {},
        else => {},
    }
}

test {
    _ = function(1);
}

Expected Behavior

$ zig test x.zig
All 1 tests passed.

Actual Behavior

$ zig test x.zig
error: OutOfMemory

This also happens without the else prong.

It does not happen if you use void instead of u8.

This is presumably caused by recursion.

0

switch cases should have to be comptime knowable

0
© 2022 pullanswer.com - All rights reserved.