mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
new inference: propagate calculated substitutor to use in B3 reduction process
(cherry picked from commit 9e70662bfae9dd6419ded2928e30b28b31eeee68)
This commit is contained in:
@@ -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;
|
||||
|
||||
+6
-1
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user