K1: rename 'kotlinCall' -> 'selectorCall' in relevant places

This commit is contained in:
Mikhail Glukhikh
2023-04-03 12:11:45 +02:00
committed by Space Team
parent bd27ec840c
commit d76b32daf2
5 changed files with 15 additions and 14 deletions
@@ -460,21 +460,21 @@ class DiagnosticReporterByTrackingStrategy(
reportArgumentConstraintErrorByPosition( reportArgumentConstraintErrorByPosition(
error, position.argument as KotlinCallArgument, error, position.argument as KotlinCallArgument,
isWarning, typeMismatchDiagnostic, isWarning, typeMismatchDiagnostic,
kotlinCall = null, report selectorCall = null, report
) )
} }
is ReceiverConstraintPosition<*> -> { is ReceiverConstraintPosition<*> -> {
reportArgumentConstraintErrorByPosition( reportArgumentConstraintErrorByPosition(
error, position.argument as KotlinCallArgument, error, position.argument as KotlinCallArgument,
isWarning, typeMismatchDiagnostic, isWarning, typeMismatchDiagnostic,
kotlinCall = (position as ReceiverConstraintPositionImpl).kotlinCall, report selectorCall = (position as ReceiverConstraintPositionImpl).selectorCall, report
) )
} }
is LambdaArgumentConstraintPosition<*> -> { is LambdaArgumentConstraintPosition<*> -> {
reportArgumentConstraintErrorByPosition( reportArgumentConstraintErrorByPosition(
error, (position.lambda as ResolvedLambdaAtom).atom, error, (position.lambda as ResolvedLambdaAtom).atom,
isWarning, typeMismatchDiagnostic, isWarning, typeMismatchDiagnostic,
kotlinCall = null, report selectorCall = null, report
) )
} }
is BuilderInferenceExpectedTypeConstraintPosition -> { is BuilderInferenceExpectedTypeConstraintPosition -> {
@@ -548,7 +548,7 @@ class DiagnosticReporterByTrackingStrategy(
argument: KotlinCallArgument, argument: KotlinCallArgument,
isWarning: Boolean, isWarning: Boolean,
typeMismatchDiagnostic: DiagnosticFactory2<KtExpression, KotlinType, KotlinType>, typeMismatchDiagnostic: DiagnosticFactory2<KtExpression, KotlinType, KotlinType>,
kotlinCall: KotlinCall?, selectorCall: KotlinCall?,
report: (Diagnostic) -> Unit report: (Diagnostic) -> Unit
) { ) {
if (argument is LambdaKotlinCallArgument) { if (argument is LambdaKotlinCallArgument) {
@@ -567,7 +567,7 @@ class DiagnosticReporterByTrackingStrategy(
} }
val expression = argument.psiExpression ?: run { val expression = argument.psiExpression ?: run {
val psiCall = (kotlinCall as? PSIKotlinCall)?.psiCall ?: psiKotlinCall.psiCall val psiCall = (selectorCall as? PSIKotlinCall)?.psiCall ?: psiKotlinCall.psiCall
report( report(
RECEIVER_TYPE_MISMATCH.on( RECEIVER_TYPE_MISMATCH.on(
psiCall.calleeExpression ?: psiCall.callElement, error.upperKotlinType, error.lowerKotlinType psiCall.calleeExpression ?: psiCall.callElement, error.upperKotlinType, error.lowerKotlinType
@@ -35,10 +35,11 @@ fun resolveKtPrimitive(
receiverInfo: ReceiverInfo, receiverInfo: ReceiverInfo,
convertedType: UnwrappedType?, convertedType: UnwrappedType?,
inferenceSession: InferenceSession?, inferenceSession: InferenceSession?,
kotlinCall: KotlinCall? = null, selectorCall: KotlinCall? = null,
): ResolvedAtom = when (argument) { ): ResolvedAtom = when (argument) {
is SimpleKotlinCallArgument -> is SimpleKotlinCallArgument -> checkSimpleArgument(
checkSimpleArgument(csBuilder, argument, expectedType, diagnosticsHolder, receiverInfo, convertedType, inferenceSession, kotlinCall) csBuilder, argument, expectedType, diagnosticsHolder, receiverInfo, convertedType, inferenceSession, selectorCall
)
is LambdaKotlinCallArgument -> is LambdaKotlinCallArgument ->
preprocessLambdaArgument(csBuilder, argument, expectedType, diagnosticsHolder) preprocessLambdaArgument(csBuilder, argument, expectedType, diagnosticsHolder)
@@ -534,7 +534,7 @@ private fun ResolutionCandidate.resolveKotlinArgument(
receiverInfo, receiverInfo,
convertedArgument?.unknownIntegerType?.unwrap(), convertedArgument?.unknownIntegerType?.unwrap(),
inferenceSession, inferenceSession,
receiverInfo.selectorCall selectorCall = receiverInfo.selectorCall
) )
addResolvedKtPrimitive(resolvedAtom) addResolvedKtPrimitive(resolvedAtom)
@@ -54,10 +54,10 @@ fun checkSimpleArgument(
receiverInfo: ReceiverInfo, receiverInfo: ReceiverInfo,
convertedType: UnwrappedType?, convertedType: UnwrappedType?,
inferenceSession: InferenceSession?, inferenceSession: InferenceSession?,
kotlinCall: KotlinCall? selectorCall: KotlinCall?
): ResolvedAtom = when (argument) { ): ResolvedAtom = when (argument) {
is ExpressionKotlinCallArgument -> is ExpressionKotlinCallArgument ->
checkExpressionArgument(csBuilder, argument, expectedType, diagnosticsHolder, receiverInfo.isReceiver, convertedType, kotlinCall) checkExpressionArgument(csBuilder, argument, expectedType, diagnosticsHolder, receiverInfo.isReceiver, convertedType, selectorCall)
is SubKotlinCallArgument -> is SubKotlinCallArgument ->
checkSubCallArgument(csBuilder, argument, expectedType, diagnosticsHolder, receiverInfo, inferenceSession) checkSubCallArgument(csBuilder, argument, expectedType, diagnosticsHolder, receiverInfo, inferenceSession)
else -> else ->
@@ -71,7 +71,7 @@ private fun checkExpressionArgument(
diagnosticsHolder: KotlinDiagnosticsHolder, diagnosticsHolder: KotlinDiagnosticsHolder,
isReceiver: Boolean, isReceiver: Boolean,
convertedType: UnwrappedType?, convertedType: UnwrappedType?,
kotlinCall: KotlinCall? selectorCall: KotlinCall?
): ResolvedAtom { ): ResolvedAtom {
val resolvedExpression = ResolvedExpressionAtom(expressionArgument) val resolvedExpression = ResolvedExpressionAtom(expressionArgument)
if (expectedType == null) return resolvedExpression if (expectedType == null) return resolvedExpression
@@ -100,7 +100,7 @@ private fun checkExpressionArgument(
} }
val position = val position =
if (isReceiver) ReceiverConstraintPositionImpl(expressionArgument, kotlinCall) if (isReceiver) ReceiverConstraintPositionImpl(expressionArgument, selectorCall)
else ArgumentConstraintPositionImpl(expressionArgument) else ArgumentConstraintPositionImpl(expressionArgument)
// Used only for arguments with @NotNull annotation // Used only for arguments with @NotNull annotation
@@ -41,7 +41,7 @@ class CallableReferenceConstraintPositionImpl(val callableReferenceCall: Callabl
class ReceiverConstraintPositionImpl( class ReceiverConstraintPositionImpl(
argument: KotlinCallArgument, argument: KotlinCallArgument,
val kotlinCall: KotlinCall? val selectorCall: KotlinCall?
) : ReceiverConstraintPosition<KotlinCallArgument>(argument) ) : ReceiverConstraintPosition<KotlinCallArgument>(argument)
class FixVariableConstraintPositionImpl( class FixVariableConstraintPositionImpl(