In progress: KT-7442 Inspection + intention to replace "if (xxx == null) return ..' with elvis

This commit is contained in:
Valentin Kipyatkov
2015-04-28 23:21:51 +03:00
parent c52f69538d
commit 8d887f8780
23 changed files with 316 additions and 0 deletions
@@ -551,6 +551,11 @@ public class JetPsiUtil {
return true;
}
// 'x ?: ...' case
if (parentExpression instanceof JetBinaryExpression && parentOperation == JetTokens.ELVIS && currentInner == ((JetBinaryExpression) parentExpression).getRight()) {
return false;
}
int innerPriority = getPriority(innerExpression);
int parentPriority = getPriority(parentExpression);