mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
new inference: accept Object/null type argument equivalence
(cherry picked from commit e631676784df65aa2f68a4fcaddcae3802d3d7df)
This commit is contained in:
+2
-1
@@ -41,7 +41,8 @@ public class SubtypingConstraint implements ConstraintFormula {
|
||||
public boolean reduce(InferenceSession session, List<ConstraintFormula> constraints) {
|
||||
if (myIsRefTypes) {
|
||||
if (session.isProperType(myS) && session.isProperType(myT)) {
|
||||
if (myT == null || myS == null) return myS == myT;
|
||||
if (myT == null) return myS == null || myS.equalsToText(CommonClassNames.JAVA_LANG_OBJECT);
|
||||
if (myS == null) return myT.equalsToText(CommonClassNames.JAVA_LANG_OBJECT);
|
||||
return TypeConversionUtil.isAssignable(myT, myS);
|
||||
}
|
||||
InferenceVariable inferenceVariable = session.getInferenceVariable(myS);
|
||||
|
||||
Reference in New Issue
Block a user