[NI] Analyse lambda in factory pattern resolution in independent context
This commit is contained in:
+2
-1
@@ -72,7 +72,8 @@ interface KotlinResolutionCallbacks {
|
||||
parameters: List<UnwrappedType>,
|
||||
expectedReturnType: UnwrappedType?, // null means, that return type is not proper i.e. it depends on some type variables
|
||||
annotations: Annotations,
|
||||
stubsForPostponedVariables: Map<NewTypeVariable, StubType>
|
||||
stubsForPostponedVariables: Map<NewTypeVariable, StubType>,
|
||||
shouldRunInIndependentContext: Boolean = false
|
||||
): ReturnArgumentsAnalysisResult
|
||||
|
||||
fun bindStubResolvedCallForCandidate(candidate: ResolvedCallAtom)
|
||||
|
||||
+2
-1
@@ -115,7 +115,8 @@ class KotlinCallCompleter(
|
||||
firstCandidate.getSystem().asPostponedArgumentsAnalyzerContext(),
|
||||
resolutionCallbacks,
|
||||
firstAtom,
|
||||
diagnosticHolderForLambda
|
||||
diagnosticHolderForLambda,
|
||||
shouldRunInIndependentContext = true
|
||||
)
|
||||
lambdas.getValue(firstCandidate).setAnalyzedResults(results.returnArgumentsInfo, listOf(firstAtom))
|
||||
|
||||
|
||||
+4
-2
@@ -70,7 +70,8 @@ class PostponedArgumentsAnalyzer(
|
||||
c: Context,
|
||||
resolutionCallbacks: KotlinResolutionCallbacks,
|
||||
lambda: ResolvedLambdaAtom,
|
||||
diagnosticHolder: KotlinDiagnosticsHolder
|
||||
diagnosticHolder: KotlinDiagnosticsHolder,
|
||||
shouldRunInIndependentContext: Boolean = false
|
||||
): ReturnArgumentsAnalysisResult {
|
||||
val stubsForPostponedVariables = c.bindingStubsForPostponedVariables()
|
||||
val currentSubstitutor = c.buildCurrentSubstitutor(stubsForPostponedVariables.mapKeys { it.key.freshTypeConstructor(c) })
|
||||
@@ -128,7 +129,8 @@ class PostponedArgumentsAnalyzer(
|
||||
parameters,
|
||||
expectedTypeForReturnArguments,
|
||||
convertedAnnotations ?: Annotations.EMPTY,
|
||||
stubsForPostponedVariables.cast()
|
||||
stubsForPostponedVariables.cast(),
|
||||
shouldRunInIndependentContext
|
||||
)
|
||||
val (returnArgumentsInfo, inferenceSession, inferedReturnType, hasInapplicableCallForBuilderInference) =
|
||||
returnArgumentsAnalysisResult
|
||||
|
||||
Reference in New Issue
Block a user