From 24680144da15de248f62b21a32d11eb18e53c4c7 Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Wed, 15 Sep 2021 14:12:46 +0200 Subject: [PATCH] [Commonizer] CirTypeDistance: Ensure consistent function signatures ^KT-48288 --- .../commonizer/mergedtree/CirTypeDistance.kt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/native/commonizer/src/org/jetbrains/kotlin/commonizer/mergedtree/CirTypeDistance.kt b/native/commonizer/src/org/jetbrains/kotlin/commonizer/mergedtree/CirTypeDistance.kt index 038531884f7..09af4a6ead5 100644 --- a/native/commonizer/src/org/jetbrains/kotlin/commonizer/mergedtree/CirTypeDistance.kt +++ b/native/commonizer/src/org/jetbrains/kotlin/commonizer/mergedtree/CirTypeDistance.kt @@ -106,25 +106,25 @@ private fun backwardsTypeDistance( val resolvedDependencyClassifier = classifiers.commonDependencies.classifier(to) ?: classifiers.targetDependencies[targetIndex].classifier(to) if (resolvedDependencyClassifier != null) { - return classifiers.backwardsTypeDistance(targetIndex, from, resolvedDependencyClassifier) + return backwardsTypeDistance(classifiers, targetIndex, from, resolvedDependencyClassifier) } val resolvedClassifier = classifiers.classifierIndices[targetIndex].findClassifier(to) ?: return unreachable - return classifiers.backwardsTypeDistance(targetIndex, from, resolvedClassifier) + return backwardsTypeDistance(classifiers, targetIndex, from, resolvedClassifier) } -private fun CirKnownClassifiers.backwardsTypeDistance( - targetIndex: Int, from: CirEntityId, to: CirProvided.Classifier +private fun backwardsTypeDistance( + classifiers: CirKnownClassifiers, targetIndex: Int, from: CirEntityId, to: CirProvided.Classifier ): CirTypeDistance { if (to !is CirProvided.TypeAlias) return unreachable if (to.underlyingType.classifierId == from) return CirTypeDistance(-1) - return backwardsTypeDistance(this, targetIndex, from, to.underlyingType.classifierId) - 1 + return backwardsTypeDistance(classifiers, targetIndex, from, to.underlyingType.classifierId) - 1 } -private fun CirKnownClassifiers.backwardsTypeDistance( - targetIndex: Int, from: CirEntityId, to: CirClassifier +private fun backwardsTypeDistance( + classifiers: CirKnownClassifiers, targetIndex: Int, from: CirEntityId, to: CirClassifier ): CirTypeDistance { if (to !is CirTypeAlias) return unreachable if (to.underlyingType.classifierId == from) return CirTypeDistance(-1) - return backwardsTypeDistance(this, targetIndex, from, to.underlyingType.classifierId) - 1 -} \ No newline at end of file + return backwardsTypeDistance(classifiers, targetIndex, from, to.underlyingType.classifierId) - 1 +}