Split property declaration: don't add parentheses for anonymous function

#KT-7593 Fixed
This commit is contained in:
Toshiaki Kameyama
2018-12-18 13:43:23 +09:00
committed by Mikhail Glukhikh
parent c1f75d2324
commit ea0f9d124d
4 changed files with 22 additions and 0 deletions
@@ -495,6 +495,14 @@ public class KtPsiUtil {
return false;
}
// 'x = fun {}' case
if (parentElement instanceof KtBinaryExpression &&
parentOperation == KtTokens.EQ &&
innerExpression instanceof KtNamedFunction &&
currentInner == ((KtBinaryExpression) parentElement).getRight()) {
return false;
}
if (innerExpression instanceof KtBinaryExpression) {
// '(x operator return [...]) operator ...' case
if (parentElement instanceof KtBinaryExpression) {