KMP: Put "prohbit expect/actual different annotations" under the flag

^KT-61668 Fixed

Review: https://jetbrains.team/p/kt/reviews/12062/timeline
This commit is contained in:
Nikita Bobko
2023-09-07 14:04:22 +02:00
committed by Space Team
parent 3a0c4d1087
commit 6868c95263
7 changed files with 54 additions and 8 deletions
@@ -6,6 +6,7 @@
package org.jetbrains.kotlin.backend.common.actualizer
import org.jetbrains.kotlin.KtDiagnosticReporterWithImplicitIrBasedContext
import org.jetbrains.kotlin.config.LanguageFeature
import org.jetbrains.kotlin.config.LanguageVersionSettings
import org.jetbrains.kotlin.diagnostics.DiagnosticReporter
import org.jetbrains.kotlin.ir.declarations.*
@@ -38,7 +39,9 @@ object IrActualizer {
typeSystemContext,
ktDiagnosticReporter
).collect()
IrExpectActualAnnotationMatchingChecker(expectActualMap, actualDeclarations, typeSystemContext, ktDiagnosticReporter).check()
if (languageVersionSettings.supportsFeature(LanguageFeature.MultiplatformRestrictions)) {
IrExpectActualAnnotationMatchingChecker(expectActualMap, actualDeclarations, typeSystemContext, ktDiagnosticReporter).check()
}
// 2. Remove top-only expect declarations since they are not needed anymore and should not be presented in the final IrFragment
// Expect fake-overrides from non-expect classes remain untouched since they will be actualized in the next phase.