1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00
ton/crypto/func/auto-tests/tests/invalid-bitwise-4.fc
Aleksandr Kirsanov 79721d230e
[FunC] Require parenthesis in tricky bitwise precedence cases
Example: "flags & 0xFF != 0" is equivalent to "flags & 1",
most likely it's unexpected.
Example: "a << 2 + 1" (equal to "a << 3", probably unexpected).

The only way to suppress this error for the programmer
is to use parenthesis.
2024-06-22 01:49:27 +03:00

6 lines
99 B
Text

const a = (1) <=> (0) ^ 8;
{-
@compilation_should_fail
@stderr ^ has lower precedence than <=>
-}