PsiType (PsiExpression @NotNull [] expressions) { PsiType type = null; for (PsiExpression expression : expressions) { PsiType currentType; if (expression instanceof PsiArrayInitializerExpression) { currentType = getArrayInitializerType((PsiArrayInitializerExpression)expression); } else { currentType = expression.getType(); } if (type == null) { type = currentType; } else if (!type.equals(currentType)) { return null; } } return type; }