Linting rules
E032: unused-expression
Warns when an expression statement computes a value that is immediately discarded.
Metadata
Code:E032Rule:unused-expressionStatus: Stable sincev0.0.1Quick fix: not available
What it does
Warns when an expression statement computes a value that is immediately discarded.
Why is this bad?
Such expressions usually have no effect and often indicate a typo, such as using !=
instead of = or +=.
Example
fun main(a: int, b: int) {
a != b;}Use instead:
fun main(mutate a: int, b: int) {
a -= b;
}Last updated on