B0701: operators that readers group differently need parentheses
Catalog status: active. Default severity: error. Stable name: unclear-precedence. Family: Syntax and source text.
Varc uses the C family's precedence, but asks for parentheses where the family disagrees with itself and a misreading would change the meaning: a bitwise operator (&, |, ^) next to a comparison, and a prefix operator on the left of **.
Example (Varc)
let even: Boolean = x & 1 == 0;
let y: Integer = -x ** 2;
C reads the first as x & (1 == 0) and Rust as (x & 1) == 0; Python reads the second as -(x ** 2), many readers as (-x) ** 2.
What to do
Write the grouping you mean: (x & 1) == 0, -(x ** 2) or (-x) ** 2.
Regression source and further reading
Complete regression example: source, command arguments and expected results. The fixture deliberately reproduces this diagnostic.
See syntax and source text, the code index, and diagnostic interpretation for modes, replay, fix-its and JSON.