[IR] Don't check class scopes compatibility in collectActualCallablesMatchingToSpecificExpect
This is a minor optimization. This commit is a step forward for KT-62590 Conceptually, `checkClassScopesCompatibility` belongs to the "expect-actual checker". It doesn't belong to the "expect-actual matcher". - `checkClassScopesCompatibility` should be set to `true` when you want to do the "checking" - `checkClassScopesCompatibility` should be set to `false` when you want to do the "matching" `collectActualCallablesMatchingToSpecificExpect` only needs the "matching" No tests changed their behaviour Review: https://jetbrains.team/p/kt/reviews/12750/timeline
This commit is contained in:
+1
@@ -223,6 +223,7 @@ private class ExpectActualLinkCollector : IrElementVisitor<Unit, ExpectActualLin
|
|||||||
expectSymbol,
|
expectSymbol,
|
||||||
actualSymbols,
|
actualSymbols,
|
||||||
context,
|
context,
|
||||||
|
checkClassScopesCompatibility = true
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -48,7 +48,8 @@ internal fun collectActualCallablesMatchingToSpecificExpect(
|
|||||||
AbstractExpectActualCompatibilityChecker.matchSingleExpectTopLevelDeclarationAgainstPotentialActuals(
|
AbstractExpectActualCompatibilityChecker.matchSingleExpectTopLevelDeclarationAgainstPotentialActuals(
|
||||||
expectSymbol,
|
expectSymbol,
|
||||||
actualSymbols,
|
actualSymbols,
|
||||||
context
|
context,
|
||||||
|
checkClassScopesCompatibility = false
|
||||||
)
|
)
|
||||||
return matchingActuals
|
return matchingActuals
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -69,6 +69,7 @@ object AbstractExpectActualCompatibilityChecker {
|
|||||||
expectDeclaration: DeclarationSymbolMarker,
|
expectDeclaration: DeclarationSymbolMarker,
|
||||||
actualDeclarations: List<DeclarationSymbolMarker>,
|
actualDeclarations: List<DeclarationSymbolMarker>,
|
||||||
context: ExpectActualMatchingContext<T>,
|
context: ExpectActualMatchingContext<T>,
|
||||||
|
checkClassScopesCompatibility: Boolean,
|
||||||
) {
|
) {
|
||||||
with(context) {
|
with(context) {
|
||||||
matchSingleExpectAgainstPotentialActuals(
|
matchSingleExpectAgainstPotentialActuals(
|
||||||
@@ -78,7 +79,7 @@ object AbstractExpectActualCompatibilityChecker {
|
|||||||
expectClassSymbol = null,
|
expectClassSymbol = null,
|
||||||
actualClassSymbol = null,
|
actualClassSymbol = null,
|
||||||
unfulfilled = null,
|
unfulfilled = null,
|
||||||
checkClassScopesCompatibility = true,
|
checkClassScopesCompatibility = checkClassScopesCompatibility,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user