diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirExpectActualDeclarationChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirExpectActualDeclarationChecker.kt index b3c218342df..003601cdb42 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirExpectActualDeclarationChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirExpectActualDeclarationChecker.kt @@ -166,23 +166,21 @@ object FirExpectActualDeclarationChecker : FirBasicDeclarationChecker() { // This is needed only to reduce the number of errors. Incompatibility errors for those members will be reported // later when this checker is called for them fun hasSingleActualSuspect( - expectedWithIncompatibility: Pair, Map>, Collection>>>, + expectedWithIncompatibility: Pair, Map>, Collection>>>, ): Boolean { val (expectedMember, incompatibility) = expectedWithIncompatibility val actualMember = incompatibility.values.singleOrNull()?.singleOrNull() @OptIn(SymbolInternals::class) return actualMember != null && - !incompatibility.allMismatches() && actualMember.fir.expectForActual?.values?.singleOrNull()?.singleOrNull() == expectedMember } val nonTrivialIncompatibleMembers = checkingCompatibility.incompatibleMembers.filterNot(::hasSingleActualSuspect) - val nonTrivialMismatchedMembers = checkingCompatibility.mismatchedMembers.filterNot(::hasSingleActualSuspect) if (nonTrivialIncompatibleMembers.isNotEmpty()) { reporter.reportOn(source, FirErrors.NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS, symbol, nonTrivialIncompatibleMembers, context) - } else if (nonTrivialMismatchedMembers.isNotEmpty()) { - reporter.reportOn(source, FirErrors.NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS, symbol, nonTrivialMismatchedMembers, context) + } else if (checkingCompatibility.mismatchedMembers.isNotEmpty()) { + reporter.reportOn(source, FirErrors.NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS, symbol, checkingCompatibility.mismatchedMembers, context) } }