mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
new inference: cleanup
This commit is contained in:
-6
@@ -20,7 +20,6 @@ import com.intellij.openapi.util.Computable;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.PsiImplUtil;
|
||||
import com.intellij.psi.impl.source.resolve.graphInference.constraints.*;
|
||||
import com.intellij.psi.infos.MethodCandidateInfo;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
@@ -360,16 +359,11 @@ public class InferenceSession {
|
||||
}
|
||||
return sameMethodCall;
|
||||
}
|
||||
|
||||
public void addCapturedVariable(PsiTypeParameter param) {
|
||||
initBounds(param);
|
||||
}
|
||||
|
||||
private void initReturnTypeConstraint(PsiMethod method, final PsiCallExpression context) {
|
||||
if (PsiPolyExpressionUtil.isMethodCallPolyExpression(context, method)) {
|
||||
PsiType returnType = method.getReturnType();
|
||||
if (!PsiType.VOID.equals(returnType) && returnType != null) {
|
||||
returnType = PsiImplUtil.normalizeWildcardTypeByPosition(returnType, context);
|
||||
PsiType targetType = PsiTypesUtil.getExpectedTypeByParent(context);
|
||||
if (targetType == null) {
|
||||
targetType = getTargetType(context);
|
||||
|
||||
+5
-1
@@ -129,7 +129,11 @@ public class ExpressionCompatibilityConstraint extends InputOutputConstraintForm
|
||||
final PsiParameter[] parameters = method.getParameterList().getParameters();
|
||||
callSession.initExpressionConstraints(parameters, args, myExpression, method);
|
||||
}
|
||||
callSession.registerConstraints(returnType, myT);
|
||||
final boolean accepted = callSession.repeatInferencePhases(true);
|
||||
if (!accepted) {
|
||||
//todo return false;
|
||||
}
|
||||
callSession.registerConstraints(returnType, substitutor.substitute(returnType));
|
||||
if (callSession.repeatInferencePhases(true)) {
|
||||
final Collection<InferenceVariable> inferenceVariables = callSession.getInferenceVariables();
|
||||
if (sameMethodCall) {
|
||||
|
||||
Reference in New Issue
Block a user