new inference: decide about NULL type later (JDK-8033407)

This commit is contained in:
Anna Kozlova
2014-02-04 18:17:53 +04:00
parent be43eeca2d
commit 2c85d0fee4
2 changed files with 5 additions and 2 deletions
@@ -50,7 +50,7 @@ public class ExpressionCompatibilityConstraint extends InputOutputConstraintForm
}
final PsiType exprType = myExpression.getType();
if (exprType != null && !exprType.equals(PsiType.NULL)) {
if (exprType != null) {
constraints.add(new TypeCompatibilityConstraint(myT, exprType));
}
return true;
@@ -49,6 +49,10 @@ public class StrictSubtypingConstraint implements ConstraintFormula {
if (myS == null) return myT.equalsToText(CommonClassNames.JAVA_LANG_OBJECT);
return TypeConversionUtil.isAssignable(myT, myS);
}
if (PsiType.NULL.equals(myS)) return true;
if (PsiType.NULL.equals(myT)) return false;
InferenceVariable inferenceVariable = session.getInferenceVariable(myS);
if (inferenceVariable != null) {
inferenceVariable.addBound(myT, InferenceBound.UPPER);
@@ -108,7 +112,6 @@ public class StrictSubtypingConstraint implements ConstraintFormula {
return true;
}
if (PsiType.NULL.equals(myT)) return false;
return true;
}