1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00
ZoKrates/zokrates_cli/examples/compile_errors/ternary_precedence.zok
2022-04-06 20:23:58 +02:00

6 lines
215 B
Text

def main(bool a) -> field {
// ternary expression should be wrapped in parentheses 1 + (a ? 2 : 3)
// otherwise the whole expression is parsed as (1 + a) ? 2 : 3
field x = 1 + a ? 2 : 3;
return x;
}