From 397e04f382ff5b389bc8e5e0001c70455958c2e8 Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Thu, 8 Jun 2017 18:40:31 +0300 Subject: [PATCH] [NI] Do not use return type from 'onlyResolvedCall' --- .../kotlin/resolve/calls/tower/NewCallArguments.kt | 2 +- .../kotlin/resolve/calls/model/ResolvedKotlinCall.kt | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/NewCallArguments.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/NewCallArguments.kt index c8eee6d2d95..f6ae5bd79b7 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/NewCallArguments.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/NewCallArguments.kt @@ -181,7 +181,7 @@ internal fun createSimplePSICallArgument( val onlyResolvedCall = ktExpression.getCall(bindingContext)?.let { bindingContext.get(BindingContext.ONLY_RESOLVED_CALL, it) } - val baseType = onlyResolvedCall?.currentReturnType ?: typeInfoForArgument.type?.unwrap() ?: return null + val baseType = typeInfoForArgument.type?.unwrap() ?: return null // we should use DFI after this argument, because there can be some useful smartcast. Popular case: if branches. val receiverToCast = transformToReceiverWithSmartCastInfo( diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/model/ResolvedKotlinCall.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/model/ResolvedKotlinCall.kt index ed614c63c09..0c1a98df09b 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/model/ResolvedKotlinCall.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/model/ResolvedKotlinCall.kt @@ -31,11 +31,7 @@ sealed class ResolvedKotlinCall { val lambdaArguments: List ): ResolvedKotlinCall() - class OnlyResolvedKotlinCall( - val candidate: KotlinResolutionCandidate - ) : ResolvedKotlinCall() { - val currentReturnType: UnwrappedType = candidate.lastCall.descriptorWithFreshTypes.returnTypeOrNothing - } + class OnlyResolvedKotlinCall(val candidate: KotlinResolutionCandidate) : ResolvedKotlinCall() } sealed class CompletedKotlinCall {