public void checkFunctionReturnType( @NotNull LexicalScope functionInnerScope, @NotNull KtDeclarationWithBody function, @NotNull FunctionDescriptor functionDescriptor, @NotNull DataFlowInfo dataFlowInfo, @Nullable KotlinType expectedReturnType, BindingTrace trace) { if (expectedReturnType == null) { expectedReturnType = functionDescriptor.getReturnType(); if (!function.hasBlockBody() && !function.hasDeclaredReturnType()) { expectedReturnType = NO_EXPECTED_TYPE; } } checkFunctionReturnType( function, ExpressionTypingContext.newContext( trace, functionInnerScope, dataFlowInfo, expectedReturnType != null ? expectedReturnType : NO_EXPECTED_TYPE)); }