[FE] Minor: rename getArgumentWithConstraintIfCompatible()
This commit is contained in:
committed by
TeamCityServer
parent
7ab9b68ad5
commit
2ce885b811
+3
-3
@@ -665,7 +665,7 @@ private data class ApplicableArgumentWithConstraint(
|
|||||||
val position: ConstraintPosition
|
val position: ConstraintPosition
|
||||||
)
|
)
|
||||||
|
|
||||||
private fun ResolutionCandidate.getArgumentWithConstraintIfCompatible(
|
private fun ResolutionCandidate.getReceiverArgumentWithConstraintIfCompatible(
|
||||||
argument: SimpleKotlinCallArgument,
|
argument: SimpleKotlinCallArgument,
|
||||||
parameter: ParameterDescriptor
|
parameter: ParameterDescriptor
|
||||||
): ApplicableArgumentWithConstraint? {
|
): ApplicableArgumentWithConstraint? {
|
||||||
@@ -711,7 +711,7 @@ internal object CheckReceivers : ResolutionPart() {
|
|||||||
return receiverCandidates.single()
|
return receiverCandidates.single()
|
||||||
}
|
}
|
||||||
val extensionReceiverParameter = candidateDescriptor.extensionReceiverParameter ?: return null
|
val extensionReceiverParameter = candidateDescriptor.extensionReceiverParameter ?: return null
|
||||||
val compatible = receiverCandidates.mapNotNull { getArgumentWithConstraintIfCompatible(it, extensionReceiverParameter) }
|
val compatible = receiverCandidates.mapNotNull { getReceiverArgumentWithConstraintIfCompatible(it, extensionReceiverParameter) }
|
||||||
return when (compatible.size) {
|
return when (compatible.size) {
|
||||||
0 -> null
|
0 -> null
|
||||||
1 -> compatible.single().argument
|
1 -> compatible.single().argument
|
||||||
@@ -875,7 +875,7 @@ internal object CheckContextReceiversResolutionPart : ResolutionPart() {
|
|||||||
for (implicitReceiverGroup in implicitReceiversGroups) {
|
for (implicitReceiverGroup in implicitReceiversGroups) {
|
||||||
val applicableArguments = implicitReceiverGroup.mapNotNull {
|
val applicableArguments = implicitReceiverGroup.mapNotNull {
|
||||||
val argument = ReceiverExpressionKotlinCallArgument(it)
|
val argument = ReceiverExpressionKotlinCallArgument(it)
|
||||||
getArgumentWithConstraintIfCompatible(argument, candidateContextReceiverParameter)
|
getReceiverArgumentWithConstraintIfCompatible(argument, candidateContextReceiverParameter)
|
||||||
}.toList()
|
}.toList()
|
||||||
if (applicableArguments.size == 1) {
|
if (applicableArguments.size == 1) {
|
||||||
val (argument, argumentType, expectedType, position) = applicableArguments.single()
|
val (argument, argumentType, expectedType, position) = applicableArguments.single()
|
||||||
|
|||||||
Reference in New Issue
Block a user