Do not generate nullable types when converting "instanceof" to "is"

This commit is contained in:
Alexey Sedunov
2013-10-18 16:30:44 +04:00
parent 054588bd3b
commit 1cb551385a
3 changed files with 6 additions and 5 deletions
@@ -192,9 +192,10 @@ public class ExpressionVisitor extends StatementVisitor {
@Override @Override
public void visitInstanceOfExpression(@NotNull PsiInstanceOfExpression expression) { public void visitInstanceOfExpression(@NotNull PsiInstanceOfExpression expression) {
super.visitInstanceOfExpression(expression); super.visitInstanceOfExpression(expression);
myResult = new IsOperator(
getConverter().expressionToExpression(expression.getOperand()), TypeElement typeElement = (TypeElement) getConverter().elementToElement(expression.getCheckType());
getConverter().elementToElement(expression.getCheckType())); typeElement.getMyType().convertedToNotNull();
myResult = new IsOperator(getConverter().expressionToExpression(expression.getOperand()), typeElement);
} }
@Override @Override
@@ -1 +1 @@
(c.getType().getName() is String?) (c.getType().getName() is String)
@@ -1 +1 @@
(a is String?) (a is String)