ApplicableType (@NotNull PsiMethod method, @NotNull PsiElement place) { ProgressManager.checkCanceled(); PsiExpressionList argumentList = ((PsiMethodCallExpression)place).getArgumentList(); MethodCandidateInfo candidateInfo = new MethodCandidateInfo(method, PsiSubstitutor.EMPTY, false, false, argumentList, null, argumentList.getExpressionTypes(), null); PsiSubstitutor substitutorForMethod = candidateInfo.getSubstitutor(); if (PsiUtil.isApplicable(method, substitutorForMethod, argumentList)) { PsiType returnType = substitutorForMethod.substitute(method.getReturnType()); if (returnType == null) return ApplicableType.APPLICABLE; return isApplicableFor(returnType); } return ApplicableType.NONE; }