[FE] Refactor: reorganize methods in AbstractExpectActualAnnotationMatchChecker

Separate callable and class checks to prepare for checking
class scopes. Extract common checks to separate methods.

Also, it is found that in IR checker annotations on type parameters also checked,
because they stored in `matchedExpectToActual`. But it is expected that
only classes and callables are checked. This started to fail because of
added input parameter type checks inside `areAnnotationsCompatible`.
That's why `expectSymbol is IrTypeParameterSymbol` early-return is added.

^KT-60668
^KT-60936
This commit is contained in:
Roman Efremov
2023-07-24 13:27:52 +02:00
committed by Space Team
parent 8cbefcc26f
commit 2f00ed3ed7
2 changed files with 53 additions and 4 deletions
@@ -13,6 +13,7 @@ import org.jetbrains.kotlin.ir.expressions.IrConstructorCall
import org.jetbrains.kotlin.ir.symbols.IrClassSymbol
import org.jetbrains.kotlin.ir.symbols.IrSymbol
import org.jetbrains.kotlin.ir.symbols.IrTypeAliasSymbol
import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol
import org.jetbrains.kotlin.ir.types.IrTypeSystemContext
import org.jetbrains.kotlin.ir.util.classIdOrFail
import org.jetbrains.kotlin.ir.util.isFakeOverride
@@ -36,6 +37,9 @@ internal class IrExpectActualAnnotationMatchingChecker(
fun check() {
for ((expectSymbol, actualSymbol) in matchedExpectToActual.entries) {
if (expectSymbol is IrTypeParameterSymbol) {
continue
}
if (expectSymbol.isFakeOverride || actualSymbol.isFakeOverride) {
continue
}