That’s all we can say right now.
This condition seems to have an assignment (like a = b
) instead of a comparison (like a == b
).
Such code can be confusing and difficult to read and debug. Consider separating out the assignment and perform only a comparison within the expression.
While this code will compile, it will also likely perform the wrong operation, since a
will always be treated as being true
.
if (a = true) {
// ...
}
For other types, compilation will likely fail because in general, constructs such as if
, for
and while
expect boolean expressions in their conditions, and will not accept other types.
Change the assignment to a comparison.
if (a == true) {
// ...
}