mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
new inference: reject explicitly typed lambda as pertinent to applicability if its return statements are poly
This commit is contained in:
+6
@@ -145,6 +145,12 @@ public class InferenceSession {
|
||||
if (psiClass instanceof PsiTypeParameter && ((PsiTypeParameter)psiClass).getOwner() == method) return false;
|
||||
}
|
||||
}
|
||||
|
||||
for (PsiExpression expression : LambdaUtil.getReturnExpressions((PsiLambdaExpression)expr)) {
|
||||
if (PsiPolyExpressionUtil.isPolyExpression(expression)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ public class SubtypingConstraint implements ConstraintFormula {
|
||||
return true;
|
||||
}
|
||||
if (PsiType.NULL.equals(myS)) return true;
|
||||
inferenceVariable = session.getInferenceVariable(myT);
|
||||
inferenceVariable = session.getInferenceVariable(myT, false);
|
||||
if (inferenceVariable != null) {
|
||||
inferenceVariable.addBound(myS, InferenceBound.LOWER);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user