leo/compiler/tests/statements/conditional/nested.leo

12 lines
167 B
Plaintext
Raw Normal View History

2020-07-31 03:11:58 +03:00
function main(a: bool, b: bool, c: u32) {
let mut d = 0u32;
2020-06-13 13:39:51 +03:00
2020-07-17 22:59:18 +03:00
if a {
2020-07-31 03:11:58 +03:00
d += 1;
2020-07-17 22:59:18 +03:00
if b {
2020-07-31 03:11:58 +03:00
d += 2;
2020-07-17 22:59:18 +03:00
}
2020-06-13 13:39:51 +03:00
}
2020-07-31 03:11:58 +03:00
assert_eq!(d, c);
2020-06-13 13:39:51 +03:00
}