From b344865c151270886fa4cdb08cb482d4c4a75f1a Mon Sep 17 00:00:00 2001 From: Stanislav Erokhin Date: Fri, 23 Jun 2017 10:03:23 +0300 Subject: [PATCH] [NI] Minor. Fixes after review --- .../resolve/calls/components/KotlinCallCompleter.kt | 5 ++--- .../resolve/calls/components/PostponeArgumentsChecks.kt | 2 +- .../kotlin/resolve/calls/components/ResolutionParts.kt | 8 +++++--- .../kotlin/resolve/calls/model/KotlinCallArguments.kt | 8 ++++---- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/KotlinCallCompleter.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/KotlinCallCompleter.kt index ba4bc5bf067..7e7c3e78281 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/KotlinCallCompleter.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/KotlinCallCompleter.kt @@ -31,7 +31,6 @@ import org.jetbrains.kotlin.resolve.calls.inference.model.NotEnoughInformationFo import org.jetbrains.kotlin.resolve.calls.inference.returnTypeOrNothing import org.jetbrains.kotlin.resolve.calls.inference.substituteAndApproximateCapturedTypes import org.jetbrains.kotlin.resolve.calls.model.* -import org.jetbrains.kotlin.resolve.calls.tower.ResolutionCandidateApplicability import org.jetbrains.kotlin.resolve.calls.tower.ResolutionCandidateStatus import org.jetbrains.kotlin.types.TypeApproximator import org.jetbrains.kotlin.types.TypeApproximatorConfiguration @@ -220,8 +219,8 @@ class KotlinCallCompleter( lambda.analyzed = true lambda.resultArguments = resolutionCallbacks.analyzeAndGetLambdaResultArguments(lambda.outerCall, lambda.argument, lambda.isSuspend, receiver, parameters, expectedType) - for (innerCall in lambda.resultArguments) { - checkSimpleArgument(c.getBuilder(), innerCall, lambda.returnType.let(::substitute)) + for (resultLambdaArgument in lambda.resultArguments) { + checkSimpleArgument(c.getBuilder(), resultLambdaArgument, lambda.returnType.let(::substitute)) } if (lambda.resultArguments.isEmpty()) { diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/PostponeArgumentsChecks.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/PostponeArgumentsChecks.kt index 639d74fb8ac..ca7a2fc415e 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/PostponeArgumentsChecks.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/PostponeArgumentsChecks.kt @@ -28,7 +28,7 @@ import org.jetbrains.kotlin.types.typeUtil.builtIns fun createPostponedArgumentAndPerformInitialChecks( kotlinCall: KotlinCall, csBuilder: ConstraintSystemBuilder, - argument: PostponableCallArgument, + argument: PostponableKotlinCallArgument, parameterDescriptor: ValueParameterDescriptor, postponeCallableReferenceArguments: MutableList ): KotlinCallDiagnostic? { diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/ResolutionParts.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/ResolutionParts.kt index 0c92fd3dda5..f4806f3f44c 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/ResolutionParts.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/ResolutionParts.kt @@ -235,9 +235,11 @@ internal object CheckArguments : ResolutionPart { for (argument in resolvedCallArgument.arguments) { val diagnostic = when (argument) { - is SimpleKotlinCallArgument -> checkSimpleArgument(csBuilder, argument, argument.getExpectedType(parameterDescriptor)) - is PostponableCallArgument -> - createPostponedArgumentAndPerformInitialChecks(kotlinCall, csBuilder, argument, parameterDescriptor, postponeCallableReferenceArguments) + is SimpleKotlinCallArgument -> + checkSimpleArgument(csBuilder, argument, argument.getExpectedType(parameterDescriptor)) + is PostponableKotlinCallArgument -> + createPostponedArgumentAndPerformInitialChecks( + kotlinCall, csBuilder, argument, parameterDescriptor, postponeCallableReferenceArguments) else -> unexpectedArgument(argument) } diagnostics.addIfNotNull(diagnostic) diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/model/KotlinCallArguments.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/model/KotlinCallArguments.kt index 80a3ad0a9dd..778d8d1f542 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/model/KotlinCallArguments.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/model/KotlinCallArguments.kt @@ -39,7 +39,7 @@ interface KotlinCallArgument { val argumentName: Name? } -interface PostponableCallArgument : KotlinCallArgument +interface PostponableKotlinCallArgument : KotlinCallArgument interface SimpleKotlinCallArgument : KotlinCallArgument, ReceiverKotlinCallArgument { override val receiver: ReceiverValueWithSmartCastInfo @@ -53,7 +53,7 @@ interface SubKotlinCallArgument : SimpleKotlinCallArgument { val resolvedCall: ResolvedKotlinCall.OnlyResolvedKotlinCall } -interface LambdaKotlinCallArgument : PostponableCallArgument { +interface LambdaKotlinCallArgument : PostponableKotlinCallArgument { override val isSpread: Boolean get() = false @@ -112,7 +112,7 @@ sealed class LHSResult { object Empty: LHSResult() } -interface CallableReferenceKotlinCallArgument : PostponableCallArgument { +interface CallableReferenceKotlinCallArgument : PostponableKotlinCallArgument { override val isSpread: Boolean get() = false @@ -121,7 +121,7 @@ interface CallableReferenceKotlinCallArgument : PostponableCallArgument { val rhsName: Name } -interface CollectionLiteralKotlinCallArgument : PostponableCallArgument +interface CollectionLiteralKotlinCallArgument : PostponableKotlinCallArgument interface TypeArgument