[NI] Fix smart cast for expression with captured input type.

This commit is contained in:
Stanislav Erokhin
2017-04-13 14:23:49 +03:00
parent 73cc1fdd9c
commit 397103f9d0
4 changed files with 21 additions and 2 deletions
@@ -150,8 +150,10 @@ internal fun createSimplePSICallArgument(
val preparedType = prepareArgumentTypeRegardingCaptureTypes(baseType) ?: baseType
val receiverToCast = context.transformToReceiverWithSmartCastInfo(
ExpressionReceiver.create(ktExpression, preparedType, context.trace.bindingContext)
)
ExpressionReceiver.create(ktExpression, baseType, context.trace.bindingContext)
).let {
ReceiverValueWithSmartCastInfo(it.receiverValue.replaceType(preparedType), it.possibleTypes, it.isStable)
}
return if (onlyResolvedCall == null) {
ExpressionKotlinCallArgumentImpl(valueArgument, context.dataFlowInfo, typeInfo.dataFlowInfo, receiverToCast)