navid/haze / cb1bac46fbd9fca0f0e2a401590740b0840b47821983a25743fc29c1572577d9 / samples/baseline_2.1/pure_loop_error.hz
pure_loop_error.hz
← samples/baseline_2.1 · 186 bytes · raw · download
pure fn checked_sum(n i32) i32 {
var total = 0
for i in 0..n
: invariant i < 4
{
total += i
}
return total
}
fn main() {
print(checked_sum(6))
}