no report 'UNNECESSARY_NOT_NULL_ASSERTION' on error types

This commit is contained in:
Svetlana Isakova
2012-09-19 15:21:45 +04:00
parent 0ff9d95704
commit 0ccdf79051
3 changed files with 13 additions and 1 deletions
@@ -885,7 +885,7 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
return typeInfo;
}
DataFlowInfo dataFlowInfo = typeInfo.getDataFlowInfo();
if (isKnownToBeNotNull(baseExpression, context)) {
if (isKnownToBeNotNull(baseExpression, context) && !ErrorUtils.isErrorType(type)) {
context.trace.report(UNNECESSARY_NOT_NULL_ASSERTION.on(operationSign, type));
}
else {