The new valiidator emits errors for non productive expressions. This because they are meaningless (produce values that are thrown away and does not cause side effects) and probably mask other problems.
While this is good in general - there are cases when developing code that makes this annoying.
Here, the entire if-expression is non productive (and it can be removed), It seems harsh to report this as an error (at all times).
I am reluctant to always turning this into a warning, but can imagine a mode where non-productive expressions are either ignored, or that they produce a warning. We could add a setting for 'non_productive_expression' and accept the values: ignore, warning, error - where error is the default.