new inference: reject explicitly typed lambda as pertinent to applicability if its return statements are poly

This commit is contained in:
anna
2013-10-07 20:54:31 +02:00
parent ae3b46c1a9
commit 57954029d0
2 changed files with 7 additions and 1 deletions
@@ -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;
}
@@ -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;