mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
new inference: decide about NULL type later (JDK-8033407)
This commit is contained in:
+1
-1
@@ -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;
|
||||
|
||||
+4
-1
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user