[FIR, IR] Commonize isFakeOverride check for AbstractExpectActualAnnotationMatchChecker
This commit fixes fakeOverrides.fir.kt test that got broken in the previous commit Previously isFakeOverride was only checked on IR backend. Now this check is moved to AbstractExpectActualAnnotationMatchChecker which is used by both: frontend and backend. That's why frontend no longer reports false positive ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT Review: https://jetbrains.team/p/kt/reviews/13094/timeline
This commit is contained in:
+2
-2
@@ -454,8 +454,8 @@ internal abstract class IrExpectActualMatchingContext(
|
||||
return !asIr().isFun
|
||||
}
|
||||
|
||||
override fun CallableSymbolMarker.shouldSkipMatching(containingExpectClass: RegularClassSymbolMarker): Boolean {
|
||||
return false
|
||||
override fun CallableSymbolMarker.isFakeOverride(containingExpectClass: RegularClassSymbolMarker?): Boolean {
|
||||
return asIr().isFakeOverride
|
||||
}
|
||||
|
||||
override val CallableSymbolMarker.hasStableParameterNames: Boolean
|
||||
|
||||
+2
-7
@@ -25,13 +25,8 @@ internal object IrExpectActualAnnotationMatchingChecker : IrExpectActualChecker
|
||||
if (expectSymbol is IrTypeParameterSymbol) {
|
||||
continue
|
||||
}
|
||||
// If the expect declaration is fake-override and is incompatible, then it means that it was overridden on actual.
|
||||
// In such case, regular rules for annotations on overridden declarations apply.
|
||||
if (expectSymbol.isFakeOverride) {
|
||||
continue
|
||||
}
|
||||
val incompatibility =
|
||||
AbstractExpectActualAnnotationMatchChecker.areAnnotationsCompatible(expectSymbol, actualSymbol, matchingContext) ?: continue
|
||||
val incompatibility = AbstractExpectActualAnnotationMatchChecker
|
||||
.areAnnotationsCompatible(expectSymbol, actualSymbol, containingExpectClass = null, matchingContext) ?: continue
|
||||
|
||||
val reportOn = getTypealiasSymbolIfActualizedViaTypealias(expectSymbol.owner as IrDeclaration, classActualizationInfo)
|
||||
?: getContainingActualClassIfFakeOverride(actualSymbol)
|
||||
|
||||
Reference in New Issue
Block a user