Remove useless cast: don't remove parentheses for lambda

#KT-28641 Fixed
This commit is contained in:
Toshiaki Kameyama
2018-12-26 17:33:35 +09:00
committed by Mikhail Glukhikh
parent d02867a831
commit 05d8932fa6
14 changed files with 115 additions and 0 deletions
@@ -448,6 +448,11 @@ public class KtPsiUtil {
}
}
if (innerExpression instanceof KtLambdaExpression) {
PsiElement prevSibling = PsiTreeUtil.skipWhitespacesAndCommentsBackward(currentInner);
if (prevSibling != null && prevSibling.getText().endsWith(KtTokens.RPAR.getValue())) return true;
}
if (parentElement instanceof KtCallExpression && currentInner == ((KtCallExpression) parentElement).getCalleeExpression()) {
KtCallExpression parentCall = (KtCallExpression) parentElement;
if (innerExpression instanceof KtSimpleNameExpression) return false;