From d76b32daf221e37dbe0659e90c7ce845fb193c68 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Mon, 3 Apr 2023 12:11:45 +0200 Subject: [PATCH] K1: rename 'kotlinCall' -> 'selectorCall' in relevant places --- .../calls/DiagnosticReporterByTrackingStrategy.kt | 10 +++++----- .../calls/components/PostponeArgumentsChecks.kt | 7 ++++--- .../kotlin/resolve/calls/components/ResolutionParts.kt | 2 +- .../resolve/calls/components/SimpleArgumentsChecks.kt | 8 ++++---- .../inference/model/ConstraintPositionAndErrorsImpl.kt | 2 +- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/DiagnosticReporterByTrackingStrategy.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/DiagnosticReporterByTrackingStrategy.kt index ac1e0414e09..baedd03225f 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/DiagnosticReporterByTrackingStrategy.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/DiagnosticReporterByTrackingStrategy.kt @@ -460,21 +460,21 @@ class DiagnosticReporterByTrackingStrategy( reportArgumentConstraintErrorByPosition( error, position.argument as KotlinCallArgument, isWarning, typeMismatchDiagnostic, - kotlinCall = null, report + selectorCall = null, report ) } is ReceiverConstraintPosition<*> -> { reportArgumentConstraintErrorByPosition( error, position.argument as KotlinCallArgument, isWarning, typeMismatchDiagnostic, - kotlinCall = (position as ReceiverConstraintPositionImpl).kotlinCall, report + selectorCall = (position as ReceiverConstraintPositionImpl).selectorCall, report ) } is LambdaArgumentConstraintPosition<*> -> { reportArgumentConstraintErrorByPosition( error, (position.lambda as ResolvedLambdaAtom).atom, isWarning, typeMismatchDiagnostic, - kotlinCall = null, report + selectorCall = null, report ) } is BuilderInferenceExpectedTypeConstraintPosition -> { @@ -548,7 +548,7 @@ class DiagnosticReporterByTrackingStrategy( argument: KotlinCallArgument, isWarning: Boolean, typeMismatchDiagnostic: DiagnosticFactory2, - kotlinCall: KotlinCall?, + selectorCall: KotlinCall?, report: (Diagnostic) -> Unit ) { if (argument is LambdaKotlinCallArgument) { @@ -567,7 +567,7 @@ class DiagnosticReporterByTrackingStrategy( } val expression = argument.psiExpression ?: run { - val psiCall = (kotlinCall as? PSIKotlinCall)?.psiCall ?: psiKotlinCall.psiCall + val psiCall = (selectorCall as? PSIKotlinCall)?.psiCall ?: psiKotlinCall.psiCall report( RECEIVER_TYPE_MISMATCH.on( psiCall.calleeExpression ?: psiCall.callElement, error.upperKotlinType, error.lowerKotlinType 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 57d4e6dedc4..3d1c79572f1 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 @@ -35,10 +35,11 @@ fun resolveKtPrimitive( receiverInfo: ReceiverInfo, convertedType: UnwrappedType?, inferenceSession: InferenceSession?, - kotlinCall: KotlinCall? = null, + selectorCall: KotlinCall? = null, ): ResolvedAtom = when (argument) { - is SimpleKotlinCallArgument -> - checkSimpleArgument(csBuilder, argument, expectedType, diagnosticsHolder, receiverInfo, convertedType, inferenceSession, kotlinCall) + is SimpleKotlinCallArgument -> checkSimpleArgument( + csBuilder, argument, expectedType, diagnosticsHolder, receiverInfo, convertedType, inferenceSession, selectorCall + ) is LambdaKotlinCallArgument -> preprocessLambdaArgument(csBuilder, argument, expectedType, diagnosticsHolder) 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 05c91720795..ffc9af53c27 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 @@ -534,7 +534,7 @@ private fun ResolutionCandidate.resolveKotlinArgument( receiverInfo, convertedArgument?.unknownIntegerType?.unwrap(), inferenceSession, - receiverInfo.selectorCall + selectorCall = receiverInfo.selectorCall ) addResolvedKtPrimitive(resolvedAtom) diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/SimpleArgumentsChecks.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/SimpleArgumentsChecks.kt index c800eaf40f8..86770a04435 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/SimpleArgumentsChecks.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/SimpleArgumentsChecks.kt @@ -54,10 +54,10 @@ fun checkSimpleArgument( receiverInfo: ReceiverInfo, convertedType: UnwrappedType?, inferenceSession: InferenceSession?, - kotlinCall: KotlinCall? + selectorCall: KotlinCall? ): ResolvedAtom = when (argument) { is ExpressionKotlinCallArgument -> - checkExpressionArgument(csBuilder, argument, expectedType, diagnosticsHolder, receiverInfo.isReceiver, convertedType, kotlinCall) + checkExpressionArgument(csBuilder, argument, expectedType, diagnosticsHolder, receiverInfo.isReceiver, convertedType, selectorCall) is SubKotlinCallArgument -> checkSubCallArgument(csBuilder, argument, expectedType, diagnosticsHolder, receiverInfo, inferenceSession) else -> @@ -71,7 +71,7 @@ private fun checkExpressionArgument( diagnosticsHolder: KotlinDiagnosticsHolder, isReceiver: Boolean, convertedType: UnwrappedType?, - kotlinCall: KotlinCall? + selectorCall: KotlinCall? ): ResolvedAtom { val resolvedExpression = ResolvedExpressionAtom(expressionArgument) if (expectedType == null) return resolvedExpression @@ -100,7 +100,7 @@ private fun checkExpressionArgument( } val position = - if (isReceiver) ReceiverConstraintPositionImpl(expressionArgument, kotlinCall) + if (isReceiver) ReceiverConstraintPositionImpl(expressionArgument, selectorCall) else ArgumentConstraintPositionImpl(expressionArgument) // Used only for arguments with @NotNull annotation diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/model/ConstraintPositionAndErrorsImpl.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/model/ConstraintPositionAndErrorsImpl.kt index 99247251895..2b038460de0 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/model/ConstraintPositionAndErrorsImpl.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/model/ConstraintPositionAndErrorsImpl.kt @@ -41,7 +41,7 @@ class CallableReferenceConstraintPositionImpl(val callableReferenceCall: Callabl class ReceiverConstraintPositionImpl( argument: KotlinCallArgument, - val kotlinCall: KotlinCall? + val selectorCall: KotlinCall? ) : ReceiverConstraintPosition(argument) class FixVariableConstraintPositionImpl(