TypeConstraint (@NotNull PsiType type) { if (type instanceof PsiLambdaExpressionType || type instanceof PsiMethodReferenceType) return TOP; type = normalizeType(type); if (type instanceof PsiDisjunctionType disjunctionType) { type = disjunctionType.getLeastUpperBound(); } if (type instanceof PsiIntersectionType intersectionType) { PsiType[] conjuncts = intersectionType.getConjuncts(); TypeConstraint result = TOP; for (PsiType conjunct : conjuncts) { Exact exact = createExact(conjunct); if (exact == null) { return new Unresolved(type.getCanonicalText()).instanceOf(); } result = result.meet(exact.instanceOf()); } return result; } Exact exact = createExact(type); if (exact == null) { return new Unresolved(type.getCanonicalText()).instanceOf(); } return exact.instanceOf(); }