1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00
ZoKrates/zokrates_cli/examples/compile_errors/ternary_precedence.zok
2021-09-16 15:54:03 +02:00

5 lines
No EOL
209 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