[FIR] 1/2 match and check expect fake-overrides vs actuals
^KT-63550 Fixed Review: https://jetbrains.team/p/kt/reviews/13094/timeline Now it's required to create a new ScopeSession when searching for expect members for actuals. If you keep reusing actualScopeSession then members declared in platform may "slip into" the search results, resulting an incorrect expect for actual (e.g. it happens in supertypeIsExpectActual_covariantOverrideOfInjectedFromSuper_transitiveSubstitutionFakeOverride.fir.kt) I suppose that it always has been a bug that we reused actualScopeSession because we were mixing actualScopeSession and expect FirSession (which is a bad idea), but we simply didn't have cases where this bug could be observed. Now after we started matching fake-overrides, we have such cases. But creating a new ScopeSession every time is a suboptimal solution. We need to design a scope caching KT-63773
This commit is contained in:
-2
@@ -217,8 +217,6 @@ object AbstractExpectActualChecker {
|
||||
val actualMembersByName = actualClassSymbol.collectAllMembers(isActualDeclaration = true).groupBy { it.name }
|
||||
|
||||
outer@ for (expectMember in expectClassSymbol.collectAllMembers(isActualDeclaration = false)) {
|
||||
if (expectMember is CallableSymbolMarker && expectMember.shouldSkipMatching(expectClassSymbol)) continue
|
||||
|
||||
val actualMembers = getPossibleActualsByExpectName(expectMember, actualMembersByName)
|
||||
|
||||
val matched = AbstractExpectActualMatcher.matchSingleExpectAgainstPotentialActuals(
|
||||
|
||||
-2
@@ -89,8 +89,6 @@ object AbstractExpectActualMatcher {
|
||||
val actualMembersByName = actualClassSymbol.collectAllMembers(isActualDeclaration = true).groupBy { it.name }
|
||||
|
||||
outer@ for (expectMember in expectClassSymbol.collectAllMembers(isActualDeclaration = false)) {
|
||||
if (expectMember is CallableSymbolMarker && expectMember.shouldSkipMatching(expectClassSymbol)) continue
|
||||
|
||||
val actualMembers = getPossibleActualsByExpectName(expectMember, actualMembersByName)
|
||||
|
||||
matchSingleExpectAgainstPotentialActuals(
|
||||
|
||||
Reference in New Issue
Block a user