diff --git a/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/results/FlatSignature.kt b/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/results/FlatSignature.kt index 2bafccf916a..e8b15a05fef 100644 --- a/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/results/FlatSignature.kt +++ b/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/results/FlatSignature.kt @@ -72,14 +72,15 @@ private fun SimpleConstraintSystem.isValueParameterTypeNotLessSpecific( var specificValueParameterTypes = specific.valueParameterTypes var generalValueParameterTypes = general.valueParameterTypes + if (specificContextReceiverCount != generalContextReceiverCount) { specificValueParameterTypes = specificValueParameterTypes.drop(specificContextReceiverCount) generalValueParameterTypes = generalValueParameterTypes.drop(generalContextReceiverCount) } - val valueParameters = specificValueParameterTypes.map(typeKindSelector).zip(generalValueParameterTypes.map(typeKindSelector)) - for ((specificType, generalType) in valueParameters) { - if (specificType == null || generalType == null) continue + for (index in specificValueParameterTypes.indices) { + val specificType = typeKindSelector(specificValueParameterTypes[index]) ?: continue + val generalType = typeKindSelector(generalValueParameterTypes[index]) ?: continue if (specificityComparator.isDefinitelyLessSpecific(specificType, generalType)) { return false