[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,
|
||||
actualSymbols,
|
||||
context,
|
||||
checkClassScopesCompatibility = true
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -48,7 +48,8 @@ internal fun collectActualCallablesMatchingToSpecificExpect(
|
||||
AbstractExpectActualCompatibilityChecker.matchSingleExpectTopLevelDeclarationAgainstPotentialActuals(
|
||||
expectSymbol,
|
||||
actualSymbols,
|
||||
context
|
||||
context,
|
||||
checkClassScopesCompatibility = false
|
||||
)
|
||||
return matchingActuals
|
||||
}
|
||||
|
||||
+2
-1
@@ -69,6 +69,7 @@ object AbstractExpectActualCompatibilityChecker {
|
||||
expectDeclaration: DeclarationSymbolMarker,
|
||||
actualDeclarations: List<DeclarationSymbolMarker>,
|
||||
context: ExpectActualMatchingContext<T>,
|
||||
checkClassScopesCompatibility: Boolean,
|
||||
) {
|
||||
with(context) {
|
||||
matchSingleExpectAgainstPotentialActuals(
|
||||
@@ -78,7 +79,7 @@ object AbstractExpectActualCompatibilityChecker {
|
||||
expectClassSymbol = null,
|
||||
actualClassSymbol = null,
|
||||
unfulfilled = null,
|
||||
checkClassScopesCompatibility = true,
|
||||
checkClassScopesCompatibility = checkClassScopesCompatibility,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user