DfType (@NotNull PsiFunctionalExpression expression) { PsiElement parent = PsiUtil.skipParenthesizedExprUp(expression.getParent()); PsiType psiType; if (parent instanceof PsiTypeCastExpression) { psiType = ((PsiTypeCastExpression)parent).getType(); } else { psiType = expression.getFunctionalInterfaceType(); } return (psiType == null ? DfType.TOP : TypeConstraints.exactSubtype(expression, psiType).asDfType()).meet(DfTypes.NOT_NULL_OBJECT); }