stage2: Handle lazy values for the % operator
This commit is contained in:
@@ -1721,3 +1721,18 @@ fn testAbsFloat() !void {
|
||||
fn testAbsFloatOne(in: f32, out: f32) !void {
|
||||
try expect(@fabs(@as(f32, in)) == @as(f32, out));
|
||||
}
|
||||
|
||||
test "mod lazy values" {
|
||||
{
|
||||
const X = struct { x: u32 };
|
||||
const x = @sizeOf(X);
|
||||
const y = 1 % x;
|
||||
_ = y;
|
||||
}
|
||||
{
|
||||
const X = struct { x: u32 };
|
||||
const x = @sizeOf(X);
|
||||
const y = x % 1;
|
||||
_ = y;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user