zig/doc/langref/test_comptime_shrExact_overflow.zig

7 lines
119 B
Zig

comptime {
const x = @shrExact(@as(u8, 0b10101010), 2);
_ = x;
}
// test_error=exact shift shifted out 1 bits