"as" in binary / unary expressions now checked only for original type conversion #KT-10384 Fixed

Also #KT-10386 Fixed
This commit is contained in:
Mikhail Glukhikh
2015-12-14 17:12:10 +03:00
parent 233e8e58e8
commit 49e7417741
7 changed files with 119 additions and 0 deletions
@@ -349,6 +349,11 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
KtExpression receiver = ((KtQualifiedExpression) parent).getReceiverExpression();
return PsiTreeUtil.isAncestor(receiver, expression, false);
}
// in binary expression, left argument can be a receiver and right an argument
// in unary expression, left argument can be a receiver
if (parent instanceof KtBinaryExpression || parent instanceof KtUnaryExpression) {
return true;
}
return false;
}