[NI] Use data flow info from arguments in parenthesis to resolve lambda

Fixes 'javaObjectType' and 'javaPrimitiveType'
This commit is contained in:
Mikhail Zarechenskiy
2017-06-07 13:52:31 +03:00
parent 5eb56dca60
commit badbf777df
3 changed files with 9 additions and 8 deletions
@@ -67,7 +67,7 @@ class KotlinResolutionCallbacksImpl(
}
override fun analyzeAndGetLambdaResultArguments(
topLevelCall: KotlinCall,
outerCall: KotlinCall,
lambdaArgument: LambdaKotlinCallArgument,
isSuspend: Boolean,
receiverType: UnwrappedType?,
@@ -100,9 +100,11 @@ class KotlinResolutionCallbacksImpl(
val approximatesExpectedType = typeApproximator.approximateToSubType(expectedType, TypeApproximatorConfiguration.LocalDeclaration) ?: expectedType
val actualContext = outerCallContext.replaceBindingTrace(trace).
replaceContextDependency(lambdaInfo.contextDependency).replaceExpectedType(approximatesExpectedType)
val actualContext = outerCallContext
.replaceBindingTrace(trace)
.replaceContextDependency(lambdaInfo.contextDependency)
.replaceExpectedType(approximatesExpectedType)
.replaceDataFlowInfo(outerCall.psiKotlinCall.resultDataFlowInfo)
val functionTypeInfo = expressionTypingServices.getTypeInfo(expression, actualContext)
trace.record(BindingContext.NEW_INFERENCE_LAMBDA_INFO, ktFunction, LambdaInfo.STUB_EMPTY)