Replace with safe calls forbidden for comparisons #KT-13432 Fixed

This commit is contained in:
Mikhail Glukhikh
2016-08-22 14:57:31 +03:00
parent 1fbd6678a5
commit c07906fac4
5 changed files with 16 additions and 19 deletions
@@ -91,8 +91,7 @@ class ReplaceInfixOrOperatorCallFix(element: KtExpression) : KotlinQuickFixActio
is KtBinaryExpression -> {
if (parent.left == null || parent.right == null) null
else {
if (parent.operationToken in OperatorConventions.COMPARISON_OPERATIONS &&
parent.analyze()[BindingContext.EXPECTED_EXPRESSION_TYPE, parent]?.isBoolean() ?: false) null
if (parent.operationToken in OperatorConventions.COMPARISON_OPERATIONS) null
else ReplaceInfixOrOperatorCallFix(parent)
}
}