List<PsiType> (@NotNull PsiExpression expr, boolean honorAssignments) { if (expr.getType() instanceof PsiPrimitiveType) { return Collections.emptyList(); } PsiExpression place = PsiUtil.skipParenthesizedExprDown(expr); if (place == null) return Collections.emptyList(); List<PsiType> result = null; if (!ControlFlowAnalyzer.inlinerMayInferPreciseType(place)) { GuessTypeVisitor visitor = tryGuessingTypeWithoutDfa(place, honorAssignments); if (!visitor.isDfaNeeded()) { result = visitor.mySpecificType == null ? Collections.emptyList() : Collections.singletonList(DfaPsiUtil.tryGenerify(expr, visitor.mySpecificType)); } } if (result == null) { PsiType psiType = getTypeFromDataflow(expr, honorAssignments); if (psiType instanceof PsiIntersectionType intersection) { result = ContainerUtil.mapNotNull(intersection.getConjuncts(), type -> DfaPsiUtil.tryGenerify(expr, type)); } else if (psiType != null) { result = Collections.singletonList(DfaPsiUtil.tryGenerify(expr, psiType)); } else { result = Collections.emptyList(); } } result = ContainerUtil.filter(result, t -> { PsiClass typeClass = PsiUtil.resolveClassInType(t); return typeClass == null || PsiUtil.isAccessible(typeClass, expr, null); }); if (result.equals(Collections.singletonList(TypeConversionUtil.erasure(expr.getType())))) { return Collections.emptyList(); } return result; }