[NI] Update lambda result arguments after resolution.
This commit is contained in:
committed by
Mikhail Zarechenskiy
parent
b9e9243e9d
commit
85248676d2
-2
@@ -37,8 +37,6 @@ interface KotlinResolutionCallbacks {
|
||||
// todo this is hack for some client which try to read ResolvedCall from trace before all calls completed
|
||||
fun bindStubResolvedCallForCandidate(candidate: KotlinResolutionCandidate)
|
||||
|
||||
fun completeLambdaReturnType(lambdaArgument: ResolvedLambdaArgument, returnType: KotlinType)
|
||||
|
||||
fun completeCallableReference(callableReferenceArgument: ResolvedCallableReferenceArgument,
|
||||
resultTypeParameters: List<UnwrappedType>)
|
||||
|
||||
|
||||
+2
-2
@@ -114,12 +114,12 @@ class KotlinCallCompleter(
|
||||
it.candidate.toCompletedCall(currentSubstitutor)
|
||||
}
|
||||
c.lambdaArguments.forEach {
|
||||
resolutionCallbacks.completeLambdaReturnType(it, currentSubstitutor.safeSubstitute(it.returnType))
|
||||
it.finalReturnType = currentSubstitutor.safeSubstitute(it.returnType)
|
||||
}
|
||||
c.callableReferenceArguments.forEach {
|
||||
resolutionCallbacks.completeCallableReference(it, it.myTypeVariables.map { currentSubstitutor.safeSubstitute(it.defaultType) })
|
||||
}
|
||||
return ResolvedKotlinCall.CompletedResolvedKotlinCall(completedCall, competedCalls)
|
||||
return ResolvedKotlinCall.CompletedResolvedKotlinCall(completedCall, competedCalls, c.lambdaArguments)
|
||||
}
|
||||
|
||||
private fun KotlinResolutionCandidate.toCompletedCall(substitutor: NewTypeSubstitutor): CompletedKotlinCall {
|
||||
|
||||
+1
@@ -48,6 +48,7 @@ class ResolvedLambdaArgument(
|
||||
override val outputType: UnwrappedType get() = returnType
|
||||
|
||||
lateinit var resultArguments: List<KotlinCallArgument>
|
||||
lateinit var finalReturnType: UnwrappedType
|
||||
}
|
||||
|
||||
class ResolvedCallableReferenceArgument(
|
||||
|
||||
+2
-1
@@ -27,7 +27,8 @@ import org.jetbrains.kotlin.types.UnwrappedType
|
||||
sealed class ResolvedKotlinCall {
|
||||
class CompletedResolvedKotlinCall(
|
||||
val completedCall: CompletedKotlinCall,
|
||||
val allInnerCalls: Collection<CompletedKotlinCall>
|
||||
val allInnerCalls: Collection<CompletedKotlinCall>,
|
||||
val lambdaArguments: List<ResolvedLambdaArgument>
|
||||
): ResolvedKotlinCall()
|
||||
|
||||
class OnlyResolvedKotlinCall(
|
||||
|
||||
Reference in New Issue
Block a user