PsiType (final PsiMethodCallExpression call) { PsiReferenceExpression methodExpression = call.getMethodExpression(); PsiFile file = call.getContainingFile(); final JavaResolveResult[] results = PsiImplUtil .multiResolveImpl(methodExpression, file, false, PsiReferenceExpressionImpl.OurGenericsResolver.INSTANCE); LanguageLevel languageLevel = PsiUtil.getLanguageLevel(file); final boolean genericParentOverloadResolution = doWePerformGenericMethodOverloadResolutionNow(call, languageLevel); PsiType theOnly = null; for (int i = 0; i < results.length; i++) { final JavaResolveResult candidateInfo = results[i]; PsiElement element = candidateInfo.getElement(); if (genericParentOverloadResolution && element != null && PsiPolyExpressionUtil.isMethodCallPolyExpression(call, (PsiMethod)element)) { LOG.error("poly expression evaluation during overload resolution, processing " + results.length + " results"); } final PsiType type = getResultType(call, methodExpression, candidateInfo, languageLevel, file); if (type == null) { return null; } if (i == 0) { theOnly = type; } else if (!theOnly.equals(type)) { return null; } } return PsiClassImplUtil.correctType(theOnly, file.getResolveScope()); }