leo/compiler/tests/statements/conditional/for_loop.leo

14 lines
176 B
Plaintext
Raw Normal View History

2020-07-31 03:11:58 +03:00
function main(a: bool) {
let mut b = 0u32;
2020-07-31 03:11:58 +03:00
if a {
2020-07-17 22:59:18 +03:00
for i in 0..4 {
2020-07-31 03:11:58 +03:00
b += i;
2020-07-17 22:59:18 +03:00
}
}
2020-07-31 03:11:58 +03:00
let r: u32 = if a ? 6 : 0;
assert_eq!(r, b);
}