leo/compiler/tests/field/ternary.leo

5 lines
105 B
Plaintext

function main(s: bool, a: field, b: field, c: field) {
let r = if s ? a : b;
assert_eq!(r, c);
}