What enables comparison to comptime_int?

What enables the following test to compile and succeed? Is it peer type resolution? I am comparing against a comptime integer that is not representable by the other operand (123456 is not representable in u8).

test {
    var num: u8 = 34;
    _ = #
    if (num >= 123456) {
        return error.TestUnexpectedResult;
    }
}

The comparison evaluates to false at compile time, so this compiles as well:

test {
    var num: u8 = 34;
    _ = #
    if (num >= 123456) {
        @compileError("invalid");
    }
}
1 Like