new inference: propagate calculated substitutor to use in B3 reduction process

(cherry picked from commit 9e70662bfae9dd6419ded2928e30b28b31eeee68)
This commit is contained in:
anna
2013-11-25 16:48:21 +01:00
parent 6bdc2b92c9
commit b15fa5dc98
2 changed files with 16 additions and 1 deletions
@@ -263,6 +263,16 @@ public class MethodCandidateInfo extends CandidateInfo{
return currentMethodCandidates != null ? currentMethodCandidates.get(context) : null;
}
public static void updateSubstitutor(PsiElement context, PsiSubstitutor newSubstitutor) {
final Map<PsiElement,Pair<PsiMethod,PsiSubstitutor>> currentMethodCandidates = CURRENT_CANDIDATE.get();
if (currentMethodCandidates != null) {
final Pair<PsiMethod, PsiSubstitutor> pair = currentMethodCandidates.get(context);
if (pair != null) {
currentMethodCandidates.put(context, Pair.create(pair.first, newSubstitutor));
}
}
}
public static class ApplicabilityLevel {
public static final int NOT_APPLICABLE = 1;
public static final int VARARGS = 2;
@@ -200,7 +200,12 @@ public class InferenceSession {
inferenceVariable.ignoreInstantiation();
}
doesNotContainFalseBound = repeatInferencePhases(true);
resolveBounds(myInferenceVariables.values(), mySiteSubstitutor, false);
PsiSubstitutor substitutor = resolveBounds(myInferenceVariables.values(), mySiteSubstitutor, false);
LOG.assertTrue(parent != null);
PsiExpressionList argumentList = ((PsiCallExpression)parent).getArgumentList();
LOG.assertTrue(argumentList != null);
MethodCandidateInfo.updateSubstitutor(argumentList, substitutor);
}
if (parameters != null && args != null) {