If-then to safe access/elvis: fix mistake in shouldBeTransformed

This should fix two inspection tests (implicit receiver case)
Before this commit, check of 'this' on null was accidentally
not highlighted by if-then to safe access or elvis. Now it is.
This commit is contained in:
Mikhail Glukhikh
2018-09-10 14:28:12 +03:00
parent 65f98a285a
commit 136428c7b4
@@ -313,7 +313,7 @@ internal fun KtIfExpression.shouldBeTransformed(): Boolean {
return when (condition) {
is KtBinaryExpression -> {
val baseClause = (if (condition.operationToken == KtTokens.EQEQ) `else` else then)?.unwrapBlockOrParenthesis()
!baseClause.isClauseTransformableToLetOnly(checkedExpression())
!baseClause.isClauseTransformableToLetOnly(condition.checkedExpression())
}
else -> false
}