As a result of compiler rewrite we get this: --- void main() { int[] arr; if(++arr.length) { } // Error: assignment cannot be used as a condition, perhaps == was meant? } ---
This is because the preincrement expression is lowered. ++arr.length is rewritten arr.length = arr.length + 1LU which is not allowed as IfCondition, to prevent the "=" vs "==" error.
works since 2.088