IG: handle void expected type separately

This commit is contained in:
Bas Leijdekkers
2017-04-27 19:21:50 +02:00
parent ee507b8d0b
commit bea8cec709
@@ -160,8 +160,9 @@ public class RedundantArrayForVarargsCallInspection extends GenericsInspectionTo
if (!resolveResult.isValidResult() || resolveResult.getElement() != oldRefMethod) {
return false;
}
if (callExpression.getParent() instanceof PsiExpressionStatement) return true;
final ExpectedTypeInfo[] expectedTypes = ExpectedTypesProvider.getExpectedTypes((PsiCallExpression)callExpression, false);
if (expectedTypes.length == 0) return true;
if (expectedTypes.length == 0) return false;
final PsiType expressionType = ((PsiCallExpression)copy).getType();
if (expressionType == null) return false;
for (ExpectedTypeInfo expectedType : expectedTypes) {