[NI] Do not use return type from 'onlyResolvedCall'

This commit is contained in:
Dmitry Petrov
2017-06-08 18:40:31 +03:00
committed by Mikhail Zarechenskiy
parent 5b2e66f0ca
commit 397e04f382
2 changed files with 2 additions and 6 deletions
@@ -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(
@@ -31,11 +31,7 @@ sealed class ResolvedKotlinCall {
val lambdaArguments: List<ResolvedLambdaArgument>
): ResolvedKotlinCall()
class OnlyResolvedKotlinCall(
val candidate: KotlinResolutionCandidate
) : ResolvedKotlinCall() {
val currentReturnType: UnwrappedType = candidate.lastCall.descriptorWithFreshTypes.returnTypeOrNothing
}
class OnlyResolvedKotlinCall(val candidate: KotlinResolutionCandidate) : ResolvedKotlinCall()
}
sealed class CompletedKotlinCall {