PyExpression (@NotNull PyFunction function, TypeEvalContext context) { final PyExpression returnAnnotation = getAnnotationValue(function, context); if (returnAnnotation != null) { return returnAnnotation; } final PyFunctionTypeAnnotation functionAnnotation = getFunctionTypeAnnotation(function); if (functionAnnotation != null) { return functionAnnotation.getReturnType(); } return null; }