Minor. Drop redundant parameters of 'inferReturnTypeFromExpressionBody'
Both storageManager and expressionTypingServices must be the same instances inside the resolution session and can be obtained from the DescriptorResolver fields
This commit is contained in:
@@ -1017,9 +1017,7 @@ public class DescriptorResolver {
|
|||||||
KtProperty property = getter.getProperty();
|
KtProperty property = getter.getProperty();
|
||||||
if (!property.hasDelegateExpressionOrInitializer() && property.getTypeReference() == null &&
|
if (!property.hasDelegateExpressionOrInitializer() && property.getTypeReference() == null &&
|
||||||
getter.hasBody() && !getter.hasBlockBody()) {
|
getter.hasBody() && !getter.hasBlockBody()) {
|
||||||
return inferReturnTypeFromExpressionBody(
|
return inferReturnTypeFromExpressionBody(trace, scope, DataFlowInfoFactory.EMPTY, getter, getterDescriptor);
|
||||||
storageManager, expressionTypingServices, trace, scope, DataFlowInfoFactory.EMPTY, getter, getterDescriptor
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return propertyType;
|
return propertyType;
|
||||||
@@ -1027,8 +1025,6 @@ public class DescriptorResolver {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
/*package*/ DeferredType inferReturnTypeFromExpressionBody(
|
/*package*/ DeferredType inferReturnTypeFromExpressionBody(
|
||||||
@NotNull StorageManager storageManager,
|
|
||||||
@NotNull final ExpressionTypingServices expressionTypingServices,
|
|
||||||
@NotNull final BindingTrace trace,
|
@NotNull final BindingTrace trace,
|
||||||
@NotNull final LexicalScope scope,
|
@NotNull final LexicalScope scope,
|
||||||
@NotNull final DataFlowInfo dataFlowInfo,
|
@NotNull final DataFlowInfo dataFlowInfo,
|
||||||
|
|||||||
@@ -128,8 +128,7 @@ class FunctionDescriptorResolver(
|
|||||||
builtIns.unitType
|
builtIns.unitType
|
||||||
}
|
}
|
||||||
else if (function.hasBody()) {
|
else if (function.hasBody()) {
|
||||||
descriptorResolver.inferReturnTypeFromExpressionBody(storageManager, expressionTypingServices, trace, scope,
|
descriptorResolver.inferReturnTypeFromExpressionBody(trace, scope, dataFlowInfo, function, functionDescriptor)
|
||||||
dataFlowInfo, function, functionDescriptor)
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ErrorUtils.createErrorType("No type, no body")
|
ErrorUtils.createErrorType("No type, no body")
|
||||||
|
|||||||
Reference in New Issue
Block a user