PsiType (@NotNull PsiExpression expression) { PsiType expectedType = PsiTypesUtil.getExpectedTypeByParent(expression); // try the cheaper way first if (expectedType != null) { return expectedType; } return ExpectedTypeUtils.findExpectedType(expression, false); }