[NI] Approximate implicit return type for functions

This commit is contained in:
Mikhail Zarechenskiy
2017-06-09 15:45:54 +03:00
parent ffc130f5fb
commit e74a02eb94
@@ -1158,8 +1158,9 @@ public class DescriptorResolver {
KotlinType type = expressionTypingServices.getBodyExpressionType(
trace, scope, dataFlowInfo, function, functionDescriptor);
KotlinType result = transformAnonymousTypeIfNeeded(functionDescriptor, function, type, trace);
functionsTypingVisitor.checkTypesForReturnStatements(function, trace, result);
return result;
UnwrappedType approximatedType = typeApproximator.approximateDeclarationType(result, false);
functionsTypingVisitor.checkTypesForReturnStatements(function, trace, approximatedType);
return approximatedType;
});
}