PSI: Add parentheses around annotated expressions in returns

#KT-8260 Fixed
This commit is contained in:
Alexey Sedunov
2015-06-26 14:19:25 +03:00
parent 8c9863e759
commit f6965b5004
6 changed files with 26 additions and 3 deletions
@@ -549,9 +549,8 @@ public class JetPsiUtil {
IElementType parentOperation = getOperation(parentExpression);
// 'return (@label{...})' case
if (parentExpression instanceof JetReturnExpression && innerExpression instanceof JetLabeledExpression) {
return true;
}
if (parentExpression instanceof JetReturnExpression
&& (innerExpression instanceof JetLabeledExpression || innerExpression instanceof JetAnnotatedExpression)) return true;
// '(x: Int) < y' case
if (innerExpression instanceof JetBinaryExpressionWithTypeRHS && parentOperation == JetTokens.LT) {