[NI] Store stub resolved call to trace because some clients read this before all calls are completed.
This is bad idea, but this is how it works in old inference. Now we just save old behaviour. Future plan: fix checks where we get unfinished resolved calls.
This commit is contained in:
+5
@@ -19,6 +19,7 @@ package org.jetbrains.kotlin.resolve.calls.components
|
||||
import org.jetbrains.kotlin.descriptors.CallableDescriptor
|
||||
import org.jetbrains.kotlin.resolve.calls.model.KotlinCall
|
||||
import org.jetbrains.kotlin.resolve.calls.model.KotlinCallArgument
|
||||
import org.jetbrains.kotlin.resolve.calls.model.KotlinResolutionCandidate
|
||||
import org.jetbrains.kotlin.resolve.calls.model.LambdaKotlinCallArgument
|
||||
import org.jetbrains.kotlin.types.UnwrappedType
|
||||
|
||||
@@ -34,4 +35,8 @@ interface LambdaAnalyzer {
|
||||
parameters: List<UnwrappedType>,
|
||||
expectedReturnType: UnwrappedType? // null means, that return type is not proper i.e. it depends on some type variables
|
||||
): List<KotlinCallArgument>
|
||||
|
||||
// todo this is hack for some client which try to read ResolvedCall from trace before all calls completed
|
||||
fun bindStubResolvedCallForCandidate(candidate: KotlinResolutionCandidate)
|
||||
|
||||
}
|
||||
+1
@@ -69,6 +69,7 @@ class KotlinCallCompleter(
|
||||
expectedType: UnwrappedType?,
|
||||
lambdaAnalyzer: LambdaAnalyzer
|
||||
): ResolvedKotlinCall {
|
||||
lambdaAnalyzer.bindStubResolvedCallForCandidate(candidate)
|
||||
val topLevelCall =
|
||||
if (candidate is VariableAsFunctionKotlinResolutionCandidate) {
|
||||
candidate.invokeCandidate
|
||||
|
||||
Reference in New Issue
Block a user