mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-1031
This commit is contained in:
@@ -26,7 +26,9 @@ public class GenericsUtil {
|
||||
}
|
||||
|
||||
public static PsiType getLeastUpperBound(PsiType type1, PsiType type2, PsiManager manager) {
|
||||
if (type1 instanceof PsiPrimitiveType || type2 instanceof PsiPrimitiveType) return null;
|
||||
if (TypeConversionUtil.isPrimitiveAndNotNull(type1) || TypeConversionUtil.isPrimitiveAndNotNull(type2)) return null;
|
||||
if (TypeConversionUtil.isNullType(type1)) return type2;
|
||||
if (TypeConversionUtil.isNullType(type2)) return type1;
|
||||
return getLeastUpperBound(type1, type2, new LinkedHashSet<Pair<PsiType, PsiType>>(), manager);
|
||||
}
|
||||
|
||||
|
||||
@@ -62,9 +62,9 @@ public class PsiConditionalExpressionImpl extends CompositePsiElement implements
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
if (type1 instanceof PsiPrimitiveType) type1 = ((PsiPrimitiveType)type1).getBoxedType(getManager(), getResolveScope());
|
||||
if (TypeConversionUtil.isPrimitiveAndNotNull(type1)) type1 = ((PsiPrimitiveType)type1).getBoxedType(getManager(), getResolveScope());
|
||||
if (type1 == null) return null;
|
||||
if (type2 instanceof PsiPrimitiveType) type2 = ((PsiPrimitiveType)type2).getBoxedType(getManager(), getResolveScope());
|
||||
if (TypeConversionUtil.isPrimitiveAndNotNull(type2)) type2 = ((PsiPrimitiveType)type2).getBoxedType(getManager(), getResolveScope());
|
||||
if (type2 == null) return null;
|
||||
|
||||
return GenericsUtil.getLeastUpperBound(type1, type2, getManager());
|
||||
|
||||
Reference in New Issue
Block a user