KT-19355 fix for "Variable expected" error after J2K for increment/decrement of an object field
This commit is contained in:
committed by
Ilya Kirillov
parent
748e458ad7
commit
b8cce67d2e
@@ -534,9 +534,16 @@ public class KtPsiUtil {
|
||||
return ((KtBinaryExpression) parentElement).getRight() == currentInner;
|
||||
}
|
||||
|
||||
//'-(-x)' case
|
||||
if (parentElement instanceof KtPrefixExpression && innerExpression instanceof KtPrefixExpression) {
|
||||
return innerOperation == parentOperation && (innerOperation == KtTokens.PLUS || innerOperation == KtTokens.MINUS);
|
||||
// +(++x) or +(+x) case
|
||||
if (parentOperation == KtTokens.PLUS) {
|
||||
return innerOperation == KtTokens.PLUS || innerOperation == KtTokens.PLUSPLUS;
|
||||
}
|
||||
|
||||
// -(--x) or -(-x) case
|
||||
if (parentOperation == KtTokens.MINUS) {
|
||||
return innerOperation == KtTokens.MINUS || innerOperation == KtTokens.MINUSMINUS;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user