[NI] Redo how we take care of postpone arguments

The main change here is the following: before callable reference
resolution starts directly after choosing candidate. Since now we
start resolution before call completion.
This commit is contained in:
Stanislav Erokhin
2017-06-23 14:43:18 +03:00
committed by Mikhail Zarechenskiy
parent b344865c15
commit ab2f99542a
16 changed files with 122 additions and 181 deletions
@@ -156,7 +156,7 @@ class KotlinResolutionCallbacksImpl(
}
override fun completeCallableReference(
callableReferenceArgument: ResolvedCallableReferenceArgument,
callableReferenceArgument: PostponedCallableReferenceArgument,
resultTypeParameters: List<UnwrappedType>
) {
val callableCandidate = callableReferenceArgument.callableResolutionCandidate
@@ -208,7 +208,7 @@ class KotlinResolutionCallbacksImpl(
doubleColonExpressionResolver.checkReferenceIsToAllowedMember(callableCandidate.candidate, topLevelCallContext.trace, callableReferenceExpression)
}
override fun completeCollectionLiteralCalls(collectionLiteralArgument: ResolvedCollectionLiteralArgument) {
override fun completeCollectionLiteralCalls(collectionLiteralArgument: PostponedCollectionLiteralArgument) {
val psiCallArgument = collectionLiteralArgument.argument.psiCallArgument as CollectionLiteralKotlinCallArgumentImpl
val context = psiCallArgument.outerCallContext
@@ -160,7 +160,7 @@ class KotlinToResolvedCallTransformer(
private fun runLambdaArgumentsChecks(
context: BasicCallResolutionContext,
trace: BindingTrace,
lambdaArguments: List<ResolvedLambdaArgument>
lambdaArguments: List<PostponedLambdaArgument>
) {
for (lambdaArgument in lambdaArguments) {
val returnType = lambdaArgument.finalReturnType
@@ -180,7 +180,7 @@ class KotlinToResolvedCallTransformer(
}
}
private fun updateTraceForLambdaReturnType(lambdaArgument: ResolvedLambdaArgument, trace: BindingTrace, returnType: UnwrappedType) {
private fun updateTraceForLambdaReturnType(lambdaArgument: PostponedLambdaArgument, trace: BindingTrace, returnType: UnwrappedType) {
val psiCallArgument = lambdaArgument.argument.psiCallArgument
val ktArgumentExpression: KtExpression