overload resolution: ensure validity of isApplicable call if there is exactly one potentially applicable method

This commit is contained in:
Anna Kozlova
2016-02-01 20:06:49 +03:00
parent 074aaaef53
commit 7bad4583a4
@@ -125,6 +125,11 @@ public class MethodCandidateInfo extends CandidateInfo{
final PsiMethod method = getElement();
if (isToInferApplicability()) {
if (!isOverloadCheck()) {
//ensure applicability check is performed
getSubstitutor(false);
}
//already performed checks, so if inference failed, error message should be saved
if (myInferenceError != null || !isPotentiallyCompatible()) {
return ApplicabilityLevel.NOT_APPLICABLE;