[FE 1.0] 2/2 Don't report a warning when new members are added to open expect actualization
^KT-62655 Fixed
diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated.java
index 15451277..954fb95 100644
--- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated.java
+++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated.java
@@ -653,6 +653,12 @@
}
@Test
+ @TestMetadata("overloadMethodInjectedInSuper.kt")
+ public void testOverloadMethodInjectedInSuper() throws Exception {
+ runTest("compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/overloadMethodInjectedInSuper.kt");
+ }
+
+ @Test
@TestMetadata("propertyKindOverride.kt")
public void testPropertyKindOverride() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/propertyKindOverride.kt");
diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithPsiTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithPsiTestGenerated.java
index d6b87e9..5b60c1a 100644
--- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithPsiTestGenerated.java
+++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithPsiTestGenerated.java
@@ -653,6 +653,12 @@
}
@Test
+ @TestMetadata("overloadMethodInjectedInSuper.kt")
+ public void testOverloadMethodInjectedInSuper() throws Exception {
+ runTest("compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/overloadMethodInjectedInSuper.kt");
+ }
+
+ @Test
@TestMetadata("propertyKindOverride.kt")
public void testPropertyKindOverride() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/propertyKindOverride.kt");
diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java
index 7eecc8b..0c432d2 100644
--- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java
+++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java
@@ -841,8 +841,6 @@
ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING =
DiagnosticFactory3.create(WARNING, DECLARATION_NAME);
DiagnosticFactory1<KtCallableDeclaration, K1ExpectActualMemberDiff<CallableMemberDescriptor, ClassDescriptor>>
- NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING = DiagnosticFactory1.create(WARNING, DECLARATION_NAME);
- DiagnosticFactory1<KtCallableDeclaration, K1ExpectActualMemberDiff<CallableMemberDescriptor, ClassDescriptor>>
UNKNOWN_PROBLEM_DURING_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING = DiagnosticFactory1.create(WARNING, DECLARATION_NAME);
DiagnosticFactory1<KtCallableDeclaration, K1ExpectActualMemberDiff<CallableMemberDescriptor, ClassDescriptor>>
RETURN_TYPE_CHANGED_IN_NON_FINAL_EXPECT_CLASSIFIER_ACTUALIZATION_WARNING = DiagnosticFactory1.create(WARNING, DECLARATION_RETURN_TYPE);
diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java
index a49300d..54e0fed 100644
--- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java
+++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java
@@ -403,9 +403,6 @@
CAPITALIZED_DECLARATION_NAME_WITH_KIND_AND_PLATFORM,
ExpectActualScopeDiffsRenderer.TEXT,
NAME);
- MAP.put(NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING,
- "{0}. This warning will become an error in future releases. Also see https://youtrack.jetbrains.com/issue/KT-22841 for more details",
- ExpectActualScopeDiffRenderer.INSTANCE);
MAP.put(UNKNOWN_PROBLEM_DURING_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING,
"{0}. This warning will become an error in future releases. Also see https://youtrack.jetbrains.com/issue/KT-22841 for more details",
ExpectActualScopeDiffRenderer.INSTANCE);
diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/ActualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/ActualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker.kt
index 3e12ec7..e0fb1ae 100644
--- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/ActualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker.kt
+++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/ActualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker.kt
@@ -9,13 +9,8 @@
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.diagnostics.Errors
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
-import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.psi.*
import org.jetbrains.kotlin.resolve.BindingTrace
-import org.jetbrains.kotlin.resolve.multiplatform.K1AbstractExpectActualCompatibilityChecker
-import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe
-import org.jetbrains.kotlin.resolve.descriptorUtil.getSuperClassNotAny
-import org.jetbrains.kotlin.resolve.descriptorUtil.getSuperInterfaces
import org.jetbrains.kotlin.resolve.descriptorUtil.module
import org.jetbrains.kotlin.resolve.multiplatform.*
import org.jetbrains.kotlin.resolve.scopes.MemberScope
@@ -126,7 +121,7 @@
return actualClassCallables.flatMap { actualMember ->
val potentialExpects = nameAndKindToExpectCallables[actualMember.name to actualMember.functionVsPropertyKind]
if (potentialExpects.isNullOrEmpty()) {
- listOf(K1ExpectActualMemberDiff.Kind.NonPrivateCallableAdded)
+ emptyList<K1ExpectActualMemberDiff.Kind>()
} else {
potentialExpects
.map { expectMember ->
@@ -141,9 +136,19 @@
}
.takeIf { kinds -> kinds.all { it != K1ExpectActualCompatibility.Compatible } }
.orEmpty()
- .map {
+ .mapNotNull {
when (it) {
is K1ExpectActualCompatibility.Compatible -> error("Compatible was filtered out by takeIf")
+ K1ExpectActualCompatibility.Incompatible.CallableKind,
+ K1ExpectActualCompatibility.Incompatible.ParameterCount,
+ K1ExpectActualCompatibility.Incompatible.ParameterShape,
+ K1ExpectActualCompatibility.Incompatible.ParameterTypes,
+ K1ExpectActualCompatibility.Incompatible.FunctionTypeParameterCount,
+ K1ExpectActualCompatibility.Incompatible.FunctionTypeParameterUpperBounds,
+ // Don't report "matching" (aka "strong") incompatibilities, because it's
+ // incompatibilities that happen only when a new member added
+ -> null
+
is K1ExpectActualCompatibility.Incompatible -> it.toMemberDiffKind()
// If toMemberDiffKind returns null then some Kotlin invariants described in toMemberDiffKind no longer hold.
// We can't throw exception here because it would crash the compilation.
@@ -180,8 +185,6 @@
private fun BindingTrace.reportIfPossible(diff: K1ExpectActualMemberDiff<CallableMemberDescriptor, ClassDescriptor>) {
val psi = diff.actualMember.psiIfReal ?: return
val diagnostic = when (diff.kind) {
- K1ExpectActualMemberDiff.Kind.NonPrivateCallableAdded ->
- Errors.NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING.on(psi, diff)
K1ExpectActualMemberDiff.Kind.ReturnTypeChangedInOverride ->
Errors.RETURN_TYPE_CHANGED_IN_NON_FINAL_EXPECT_CLASSIFIER_ACTUALIZATION_WARNING.on(psi, diff)
K1ExpectActualMemberDiff.Kind.ModalityChangedInOverride ->
diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/multiplatform/K1ExpectActualMemberDiff.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/multiplatform/K1ExpectActualMemberDiff.kt
index d28c746..04be55c 100644
--- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/multiplatform/K1ExpectActualMemberDiff.kt
+++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/multiplatform/K1ExpectActualMemberDiff.kt
@@ -13,10 +13,6 @@
* Also see: [toMemberDiffKind]
*/
enum class Kind(val rawMessage: String) {
- NonPrivateCallableAdded(
- "{0}: non-private member must be declared in both the actual class and the expect class. " +
- "This error happens because the expect class ''{1}'' is non-final"
- ),
ReturnTypeChangedInOverride(
"{0}: the return type of this member must be the same in the expect class and the actual class. " +
"This error happens because the expect class ''{1}'' is non-final"
@@ -61,14 +57,19 @@
}
fun K1ExpectActualCompatibility.Incompatible<*>.toMemberDiffKind(): K1ExpectActualMemberDiff.Kind? = when (this) {
- K1ExpectActualCompatibility.Incompatible.CallableKind -> K1ExpectActualMemberDiff.Kind.NonPrivateCallableAdded
- K1ExpectActualCompatibility.Incompatible.ParameterCount -> K1ExpectActualMemberDiff.Kind.NonPrivateCallableAdded
- K1ExpectActualCompatibility.Incompatible.ParameterShape -> K1ExpectActualMemberDiff.Kind.NonPrivateCallableAdded
- K1ExpectActualCompatibility.Incompatible.ParameterTypes -> K1ExpectActualMemberDiff.Kind.NonPrivateCallableAdded
+ K1ExpectActualCompatibility.Incompatible.CallableKind,
+ K1ExpectActualCompatibility.Incompatible.ParameterCount,
+ K1ExpectActualCompatibility.Incompatible.ParameterShape,
+ K1ExpectActualCompatibility.Incompatible.ParameterTypes,
+ K1ExpectActualCompatibility.Incompatible.FunctionTypeParameterCount,
+ K1ExpectActualCompatibility.Incompatible.FunctionTypeParameterUpperBounds,
+ // It's an awful API. But we don't care because it's in K1. And K1 won't ever change anymore
+ // I could have created a nice API (replace K1ExpectActualCompatibility.Incompatible extension receiver with WeakIncompatible),
+ // if we didn't have this bug: KT-62752
+ -> error("It's not allowed to call this function with receiver: $this")
+
K1ExpectActualCompatibility.Incompatible.ReturnType -> K1ExpectActualMemberDiff.Kind.ReturnTypeChangedInOverride
- K1ExpectActualCompatibility.Incompatible.FunctionTypeParameterCount -> K1ExpectActualMemberDiff.Kind.NonPrivateCallableAdded
K1ExpectActualCompatibility.Incompatible.ClassTypeParameterCount -> error("Not applicable because K1ExpectActualMemberDiff is about members")
- K1ExpectActualCompatibility.Incompatible.FunctionTypeParameterUpperBounds -> K1ExpectActualMemberDiff.Kind.NonPrivateCallableAdded
K1ExpectActualCompatibility.Incompatible.ClassTypeParameterUpperBounds -> error("Not applicable because K1ExpectActualMemberDiff is about members")
K1ExpectActualCompatibility.Incompatible.ActualFunctionWithDefaultParameters -> null // It's not possible to add default parameters in override
K1ExpectActualCompatibility.Incompatible.ClassKind -> error("Not applicable because K1ExpectActualMemberDiff is about members")
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/actualTypealias.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/actualTypealias.fir.kt
deleted file mode 100644
index 9e5b081..0000000
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/actualTypealias.fir.kt
+++ /dev/null
@@ -1,19 +0,0 @@
-// MODULE: m1-common
-// FILE: common.kt
-
-expect open class Foo {
- fun existingMethod()
- val existingParam: Int
-}
-
-// MODULE: m2-jvm()()(m1-common)
-// FILE: jvm.kt
-
-actual typealias Foo = FooImpl
-
-open class FooImpl {
- fun existingMethod() {}
- val existingParam: Int = 904
-
- fun injectedMethod() {} // accidential override can happen with this injected fun. That's why it's prohibited
-}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/actualTypealias.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/actualTypealias.kt
index 7df0487..180e228 100644
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/actualTypealias.kt
+++ b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/actualTypealias.kt
@@ -1,3 +1,4 @@
+// FIR_IDENTICAL
// MODULE: m1-common
// FILE: common.kt
@@ -9,11 +10,11 @@
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
-actual typealias <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>Foo<!> = FooImpl
+actual typealias Foo = FooImpl
open class FooImpl {
fun existingMethod() {}
val existingParam: Int = 904
- fun injectedMethod() {} // accidential override can happen with this injected fun. That's why it's prohibited
+ fun injectedMethod() {}
}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectExtensionReceiverOverload.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectExtensionReceiverOverload.fir.kt
deleted file mode 100644
index 10dbaed..0000000
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectExtensionReceiverOverload.fir.kt
+++ /dev/null
@@ -1,15 +0,0 @@
-// MODULE: m1-common
-// FILE: common.kt
-
-expect open class Foo {
- fun foo()
-}
-
-// MODULE: m2-jvm()()(m1-common)
-// FILE: jvm.kt
-
-actual open class Foo {
- actual fun foo() {}
-
- fun Int.foo() {} // accidential override can happen with this injected fun. That's why it's prohibited
-}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectExtensionReceiverOverload.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectExtensionReceiverOverload.kt
index 049505e..7992108 100644
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectExtensionReceiverOverload.kt
+++ b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectExtensionReceiverOverload.kt
@@ -1,3 +1,4 @@
+// FIR_IDENTICAL
// MODULE: m1-common
// FILE: common.kt
@@ -8,8 +9,8 @@
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
-actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Foo<!> {
+actual open class Foo {
actual fun foo() {}
- fun Int.<!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>foo<!>() {} // accidential override can happen with this injected fun. That's why it's prohibited
+ fun Int.foo() {}
}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectGenericUpperBoundOverload.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectGenericUpperBoundOverload.fir.kt
deleted file mode 100644
index 52d59ae..0000000
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectGenericUpperBoundOverload.fir.kt
+++ /dev/null
@@ -1,15 +0,0 @@
-// MODULE: m1-common
-// FILE: common.kt
-
-open class Base {
- fun <T> foo(t: T) {}
-}
-
-expect open class Foo : Base
-
-// MODULE: m2-jvm()()(m1-common)
-// FILE: jvm.kt
-
-actual open class Foo : Base() {
- fun <T : Comparable<T>> foo(t: T) {}
-}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectGenericUpperBoundOverload.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectGenericUpperBoundOverload.kt
index e782bff..01c2b38 100644
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectGenericUpperBoundOverload.kt
+++ b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectGenericUpperBoundOverload.kt
@@ -1,3 +1,4 @@
+// FIR_IDENTICAL
// MODULE: m1-common
// FILE: common.kt
@@ -10,6 +11,6 @@
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
-actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Foo<!> : Base() {
- fun <T : Comparable<T>> <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>foo<!>(t: T) {}
+actual open class Foo : Base() {
+ fun <T : Comparable<T>> foo(t: T) {}
}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectMethod_internalMethod.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectMethod_internalMethod.fir.kt
deleted file mode 100644
index b3a8e7f..0000000
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectMethod_internalMethod.fir.kt
+++ /dev/null
@@ -1,17 +0,0 @@
-// MODULE: m1-common
-// FILE: common.kt
-
-expect open class Foo {
- fun existingMethod()
- val existingParam: Int
-}
-
-// MODULE: m2-jvm()()(m1-common)
-// FILE: jvm.kt
-
-actual open class Foo {
- actual fun existingMethod() {}
- actual val existingParam: Int = 904
-
- internal fun injectedMethod() {} // accidential override can happen with this injected fun. That's why it's prohibited
-}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectMethod_internalMethod.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectMethod_internalMethod.kt
index b6a6205..e57d8a0 100644
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectMethod_internalMethod.kt
+++ b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectMethod_internalMethod.kt
@@ -1,3 +1,4 @@
+// FIR_IDENTICAL
// MODULE: m1-common
// FILE: common.kt
@@ -9,9 +10,9 @@
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
-actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Foo<!> {
+actual open class Foo {
actual fun existingMethod() {}
actual val existingParam: Int = 904
- internal fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>injectedMethod<!>() {} // accidential override can happen with this injected fun. That's why it's prohibited
+ internal fun injectedMethod() {}
}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectMethod_protectedMethod.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectMethod_protectedMethod.fir.kt
deleted file mode 100644
index 3f2c5ca..0000000
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectMethod_protectedMethod.fir.kt
+++ /dev/null
@@ -1,17 +0,0 @@
-// MODULE: m1-common
-// FILE: common.kt
-
-expect open class Foo {
- fun existingMethod()
- val existingParam: Int
-}
-
-// MODULE: m2-jvm()()(m1-common)
-// FILE: jvm.kt
-
-actual open class Foo {
- actual fun existingMethod() {}
- actual val existingParam: Int = 904
-
- protected fun injectedMethod() {} // accidential override can happen with this injected fun. That's why it's prohibited
-}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectMethod_protectedMethod.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectMethod_protectedMethod.kt
index 0858a83..19a5d8f 100644
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectMethod_protectedMethod.kt
+++ b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectMethod_protectedMethod.kt
@@ -1,3 +1,4 @@
+// FIR_IDENTICAL
// MODULE: m1-common
// FILE: common.kt
@@ -9,9 +10,9 @@
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
-actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Foo<!> {
+actual open class Foo {
actual fun existingMethod() {}
actual val existingParam: Int = 904
- protected fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>injectedMethod<!>() {} // accidential override can happen with this injected fun. That's why it's prohibited
+ protected fun injectedMethod() {}
}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectMethod_publicMethod.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectMethod_publicMethod.fir.kt
deleted file mode 100644
index 2c01e6b..0000000
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectMethod_publicMethod.fir.kt
+++ /dev/null
@@ -1,17 +0,0 @@
-// MODULE: m1-common
-// FILE: common.kt
-
-expect open class Foo {
- fun existingMethod()
- val existingParam: Int
-}
-
-// MODULE: m2-jvm()()(m1-common)
-// FILE: jvm.kt
-
-actual open class Foo {
- actual fun existingMethod() {}
- actual val existingParam: Int = 904
-
- fun injectedMethod() {} // accidential override can happen with this injected fun. That's why it's prohibited
-}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectMethod_publicMethod.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectMethod_publicMethod.kt
index 9f3bdd8..3e46cbc 100644
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectMethod_publicMethod.kt
+++ b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectMethod_publicMethod.kt
@@ -1,3 +1,4 @@
+// FIR_IDENTICAL
// MODULE: m1-common
// FILE: common.kt
@@ -9,9 +10,9 @@
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
-actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Foo<!> {
+actual open class Foo {
actual fun existingMethod() {}
actual val existingParam: Int = 904
- fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>injectedMethod<!>() {} // accidential override can happen with this injected fun. That's why it's prohibited
+ fun injectedMethod() {}
}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectMethod_publicMethodInJava.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectMethod_publicMethodInJava.fir.kt
deleted file mode 100644
index b5cdadf..0000000
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectMethod_publicMethodInJava.fir.kt
+++ /dev/null
@@ -1,19 +0,0 @@
-// MODULE: m1-common
-// FILE: common.kt
-
-expect open class Foo {
- fun existingMethod()
-}
-
-// MODULE: m2-jvm()()(m1-common)
-// FILE: jvm.kt
-
-actual typealias Foo = FooImpl
-
-// FILE: Foo.java
-
-public class FooImpl {
- public void existingMethod() {}
-
- public void injectedMethod() {}
-}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectMethod_publicMethodInJava.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectMethod_publicMethodInJava.kt
index 273322c..9d3df19 100644
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectMethod_publicMethodInJava.kt
+++ b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectMethod_publicMethodInJava.kt
@@ -1,3 +1,4 @@
+// FIR_IDENTICAL
// MODULE: m1-common
// FILE: common.kt
@@ -8,7 +9,7 @@
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
-actual typealias <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>Foo<!> = FooImpl
+actual typealias Foo = FooImpl
// FILE: Foo.java
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectParameterOverload.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectParameterOverload.fir.kt
deleted file mode 100644
index adb9cd6..0000000
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectParameterOverload.fir.kt
+++ /dev/null
@@ -1,15 +0,0 @@
-// MODULE: m1-common
-// FILE: common.kt
-
-expect open class Foo {
- fun foo()
-}
-
-// MODULE: m2-jvm()()(m1-common)
-// FILE: jvm.kt
-
-actual open class Foo {
- actual fun foo() {}
-
- fun foo(overloaded: Int) {} // accidential override can happen with this injected fun. That's why it's prohibited
-}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectParameterOverload.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectParameterOverload.kt
index b314173..cc8f20f 100644
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectParameterOverload.kt
+++ b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectParameterOverload.kt
@@ -1,3 +1,4 @@
+// FIR_IDENTICAL
// MODULE: m1-common
// FILE: common.kt
@@ -8,8 +9,8 @@
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
-actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Foo<!> {
+actual open class Foo {
actual fun foo() {}
- fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>foo<!>(overloaded: Int) {} // accidential override can happen with this injected fun. That's why it's prohibited
+ fun foo(overloaded: Int) {}
}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectParameterOverloadWithGenerics.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectParameterOverloadWithGenerics.fir.kt
deleted file mode 100644
index 552efaa..0000000
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectParameterOverloadWithGenerics.fir.kt
+++ /dev/null
@@ -1,15 +0,0 @@
-// MODULE: m1-common
-// FILE: common.kt
-
-open class Base<T> {
- open fun foo(t: T) {}
-}
-
-expect open class Foo<R> : Base<R>
-
-// MODULE: m2-jvm()()(m1-common)
-// FILE: jvm.kt
-
-actual open class Foo<R>() : Base<R>() {
- fun <T> foo(t: T) {}
-}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectParameterOverloadWithGenerics.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectParameterOverloadWithGenerics.kt
index 2291ca0..f070994 100644
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectParameterOverloadWithGenerics.kt
+++ b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectParameterOverloadWithGenerics.kt
@@ -1,3 +1,4 @@
+// FIR_IDENTICAL
// MODULE: m1-common
// FILE: common.kt
@@ -10,6 +11,6 @@
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
-actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Foo<!><R>() : Base<R>() {
- fun <T> <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>foo<!>(t: T) {}
+actual open class Foo<R>() : Base<R>() {
+ fun <T> foo(t: T) {}
}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectProperty.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectProperty.fir.kt
deleted file mode 100644
index e433fb1..0000000
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectProperty.fir.kt
+++ /dev/null
@@ -1,17 +0,0 @@
-// MODULE: m1-common
-// FILE: common.kt
-
-expect open class Foo {
- fun existingFun()
- val existingParam: Int
-}
-
-// MODULE: m2-jvm()()(m1-common)
-// FILE: jvm.kt
-
-actual open class Foo {
- actual fun existingFun() {}
- actual val existingParam: Int = 904
-
- val injectedProperty = 1
-}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectProperty.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectProperty.kt
index 103e13a..9edbb50 100644
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectProperty.kt
+++ b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectProperty.kt
@@ -1,3 +1,4 @@
+// FIR_IDENTICAL
// MODULE: m1-common
// FILE: common.kt
@@ -9,9 +10,9 @@
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
-actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Foo<!> {
+actual open class Foo {
actual fun existingFun() {}
actual val existingParam: Int = 904
- val <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>injectedProperty<!> = 1
+ val injectedProperty = 1
}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectPropertyWithTheSameSignatureAsExistingFunction.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectPropertyWithTheSameSignatureAsExistingFunction.fir.kt
deleted file mode 100644
index e7a6691..0000000
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectPropertyWithTheSameSignatureAsExistingFunction.fir.kt
+++ /dev/null
@@ -1,15 +0,0 @@
-// MODULE: m1-common
-// FILE: common.kt
-
-expect open class Foo {
- fun foo(): Int
-}
-
-// MODULE: m2-jvm()()(m1-common)
-// FILE: jvm.kt
-
-actual open class Foo {
- actual fun foo(): Int = 904
-
- val foo: Int = 42
-}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectPropertyWithTheSameSignatureAsExistingFunction.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectPropertyWithTheSameSignatureAsExistingFunction.kt
index 4002701..0fdbf34 100644
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectPropertyWithTheSameSignatureAsExistingFunction.kt
+++ b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectPropertyWithTheSameSignatureAsExistingFunction.kt
@@ -1,3 +1,4 @@
+// FIR_IDENTICAL
// MODULE: m1-common
// FILE: common.kt
@@ -8,8 +9,8 @@
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
-actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Foo<!> {
+actual open class Foo {
actual fun foo(): Int = 904
- val <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>foo<!>: Int = 42
+ val foo: Int = 42
}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectVarargParameterOverload.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectVarargParameterOverload.fir.kt
deleted file mode 100644
index 2616b56..0000000
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectVarargParameterOverload.fir.kt
+++ /dev/null
@@ -1,15 +0,0 @@
-// MODULE: m1-common
-// FILE: common.kt
-
-open class Base {
- open fun foo(t: String) {}
-}
-
-expect open class Foo : Base
-
-// MODULE: m2-jvm()()(m1-common)
-// FILE: jvm.kt
-
-actual open class Foo : Base() {
- open fun foo(vararg t: String) {} // injected
-}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectVarargParameterOverload.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectVarargParameterOverload.kt
index 4908989..110af36 100644
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectVarargParameterOverload.kt
+++ b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectVarargParameterOverload.kt
@@ -1,3 +1,4 @@
+// FIR_IDENTICAL
// MODULE: m1-common
// FILE: common.kt
@@ -10,6 +11,6 @@
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
-actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Foo<!> : Base() {
- open fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>foo<!>(vararg t: String) {} // injected
+actual open class Foo : Base() {
+ open fun foo(vararg t: String) {} // injected
}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/kt62027.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/kt62027.fir.kt
deleted file mode 100644
index e144e74..0000000
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/kt62027.fir.kt
+++ /dev/null
@@ -1,14 +0,0 @@
-// MODULE: m1-common
-// FILE: common.kt
-
-expect open class Foo {
- fun <T> foo(t: T)
-}
-
-// MODULE: m2-jvm()()(m1-common)
-// FILE: jvm.kt
-
-actual open class Foo {
- actual fun <T> foo(t: T) {}
- fun foo(t: String) {}
-}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/kt62027.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/kt62027.kt
index b41aba6..31b694b 100644
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/kt62027.kt
+++ b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/kt62027.kt
@@ -1,3 +1,4 @@
+// FIR_IDENTICAL
// MODULE: m1-common
// FILE: common.kt
@@ -8,7 +9,7 @@
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
-actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Foo<!> {
+actual open class Foo {
actual fun <T> foo(t: T) {}
- fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>foo<!>(t: String) {}
+ fun foo(t: String) {}
}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/nestedExpectOpenClass.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/nestedExpectOpenClass.fir.kt
deleted file mode 100644
index af1a182..0000000
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/nestedExpectOpenClass.fir.kt
+++ /dev/null
@@ -1,22 +0,0 @@
-// MODULE: m1-common
-// FILE: common.kt
-
-// Rules for expect actual matching are ad-hoc for nested classes. That's why this test exist
-expect class Outer {
- open class Foo {
- fun existingMethod()
- val existingParam: Int
- }
-}
-
-// MODULE: m2-jvm()()(m1-common)
-// FILE: jvm.kt
-
-actual class Outer {
- actual open class Foo {
- actual fun existingMethod() {}
- actual val existingParam: Int = 904
-
- fun injectedMethod() {} // accidential override can happen with this injected fun. That's why it's prohibited
- }
-}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/nestedExpectOpenClass.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/nestedExpectOpenClass.kt
index bba1ecc..11b61a3 100644
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/nestedExpectOpenClass.kt
+++ b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/nestedExpectOpenClass.kt
@@ -1,3 +1,4 @@
+// FIR_IDENTICAL
// MODULE: m1-common
// FILE: common.kt
@@ -13,10 +14,10 @@
// FILE: jvm.kt
actual class Outer {
- actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Foo<!> {
+ actual open class Foo {
actual fun existingMethod() {}
actual val existingParam: Int = 904
- fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>injectedMethod<!>() {} // accidential override can happen with this injected fun. That's why it's prohibited
+ fun injectedMethod() {}
}
}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/overloadMethodInjectedInSuper.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/overloadMethodInjectedInSuper.fir.kt
new file mode 100644
index 0000000..42aa8a0
--- /dev/null
+++ b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/overloadMethodInjectedInSuper.fir.kt
@@ -0,0 +1,21 @@
+// MODULE: m1-common
+// FILE: common.kt
+
+expect open class Base
+
+expect open class Foo : Base {
+ fun foo(param: Int)
+}
+
+// MODULE: m2-jvm()()(m1-common)
+// FILE: jvm.kt
+
+actual open class Base {
+ open fun foo(): Any = ""
+}
+
+actual open class Foo : Base() {
+ override fun foo(): String = ""
+
+ actual fun foo(param: Int) {}
+}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/overloadMethodInjectedInSuper.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/overloadMethodInjectedInSuper.kt
new file mode 100644
index 0000000..35e8482
--- /dev/null
+++ b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/overloadMethodInjectedInSuper.kt
@@ -0,0 +1,21 @@
+// MODULE: m1-common
+// FILE: common.kt
+
+expect open class Base
+
+expect open class Foo : Base {
+ fun foo(param: Int)
+}
+
+// MODULE: m2-jvm()()(m1-common)
+// FILE: jvm.kt
+
+actual open class Base {
+ open fun foo(): Any = ""
+}
+
+actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Foo<!> : Base() {
+ override fun foo(): <!RETURN_TYPE_CHANGED_IN_NON_FINAL_EXPECT_CLASSIFIER_ACTUALIZATION_WARNING!>String<!> = ""
+
+ actual fun foo(param: Int) {}
+}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/severalMismatches.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/severalMismatches.kt
index 18faf9f..08f57ca 100644
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/severalMismatches.kt
+++ b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/severalMismatches.kt
@@ -20,8 +20,8 @@
actual fun existingMethod() {}
actual val existingParam: Int = 904
- fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>injectedMethod<!>() {}
- val <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>injectedProperty<!>: Int = 42
+ fun injectedMethod() {}
+ val injectedProperty: Int = 42
override fun overrideReturnType(): <!RETURN_TYPE_CHANGED_IN_NON_FINAL_EXPECT_CLASSIFIER_ACTUALIZATION_WARNING!>String<!> = ""
<!MODALITY_CHANGED_IN_NON_FINAL_EXPECT_CLASSIFIER_ACTUALIZATION_WARNING!>final<!> override fun overrideModality1(): Any = ""
<!MODALITY_CHANGED_IN_NON_FINAL_EXPECT_CLASSIFIER_ACTUALIZATION_WARNING!>final<!> override fun overrideModality2(): Any = ""
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_covariantOverrideOfInjectedFromSuper.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_covariantOverrideOfInjectedFromSuper.kt
index c7df534..9f03e2a 100644
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_covariantOverrideOfInjectedFromSuper.kt
+++ b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_covariantOverrideOfInjectedFromSuper.kt
@@ -14,9 +14,9 @@
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
-actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Base<!> {
+actual open class Base {
actual fun existingMethodInBase() {}
- open fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>injected<!>(): Any = ""
+ open fun injected(): Any = ""
}
actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Foo<!> : Base() {
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_covariantOverrideOfInjectedFromSuper_transitiveSubstitutionFakeOverride.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_covariantOverrideOfInjectedFromSuper_transitiveSubstitutionFakeOverride.kt
index 304e982..46ab2ed 100644
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_covariantOverrideOfInjectedFromSuper_transitiveSubstitutionFakeOverride.kt
+++ b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_covariantOverrideOfInjectedFromSuper_transitiveSubstitutionFakeOverride.kt
@@ -16,9 +16,9 @@
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
-actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Base<!><T> {
+actual open class Base<T> {
actual fun existingMethodInBase(param: T) {}
- open fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>injected<!>(param: T): Any = ""
+ open fun injected(param: T): Any = ""
}
actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Foo<!> : Transitive() {
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_injectMethod.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_injectMethod.fir.kt
deleted file mode 100644
index 7b46691..0000000
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_injectMethod.fir.kt
+++ /dev/null
@@ -1,25 +0,0 @@
-// WITH_STDLIB
-// MODULE: m1-common
-// FILE: common.kt
-
-expect open class Base {
- fun existingMethodInBase()
-}
-
-expect open class Foo : Base {
- fun existingMethod()
- val existingParam: Int
-}
-
-// MODULE: m2-jvm()()(m1-common)
-// FILE: jvm.kt
-
-actual open class Base {
- actual fun existingMethodInBase() {}
- fun injected() {}
-}
-
-actual open class Foo : Base() {
- actual fun existingMethod() {}
- actual val existingParam: Int = 904
-}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_injectMethod.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_injectMethod.kt
index 730fc89..b09eac0 100644
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_injectMethod.kt
+++ b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_injectMethod.kt
@@ -1,3 +1,4 @@
+// FIR_IDENTICAL
// WITH_STDLIB
// MODULE: m1-common
// FILE: common.kt
@@ -14,9 +15,9 @@
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
-actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Base<!> {
+actual open class Base {
actual fun existingMethodInBase() {}
- fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>injected<!>() {}
+ fun injected() {}
}
actual open class Foo : Base() {
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_injectMethod_transitiveSubstitutionFakeOverride.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_injectMethod_transitiveSubstitutionFakeOverride.fir.kt
deleted file mode 100644
index 7013434..0000000
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_injectMethod_transitiveSubstitutionFakeOverride.fir.kt
+++ /dev/null
@@ -1,27 +0,0 @@
-// WITH_STDLIB
-// MODULE: m1-common
-// FILE: common.kt
-
-expect open class Base<T>() {
- fun existingMethodInBase(param: T)
-}
-
-open class Transitive : Base<String>()
-
-expect open class Foo : Transitive {
- fun existingMethod()
- val existingParam: Int
-}
-
-// MODULE: m2-jvm()()(m1-common)
-// FILE: jvm.kt
-
-actual open class Base<T> {
- actual fun existingMethodInBase(param: T) {}
- fun injected() {}
-}
-
-actual open class Foo : Transitive() {
- actual fun existingMethod() {}
- actual val existingParam: Int = 904
-}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_injectMethod_transitiveSubstitutionFakeOverride.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_injectMethod_transitiveSubstitutionFakeOverride.kt
index 635f3a1..4fbc933 100644
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_injectMethod_transitiveSubstitutionFakeOverride.kt
+++ b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_injectMethod_transitiveSubstitutionFakeOverride.kt
@@ -1,3 +1,4 @@
+// FIR_IDENTICAL
// WITH_STDLIB
// MODULE: m1-common
// FILE: common.kt
@@ -16,9 +17,9 @@
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
-actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Base<!><T> {
+actual open class Base<T> {
actual fun existingMethodInBase(param: T) {}
- fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>injected<!>() {}
+ fun injected() {}
}
actual open class Foo : Transitive() {
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_supertypeIsActualTypealias_injectMethod.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_supertypeIsActualTypealias_injectMethod.fir.kt
deleted file mode 100644
index ff70207..0000000
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_supertypeIsActualTypealias_injectMethod.fir.kt
+++ /dev/null
@@ -1,27 +0,0 @@
-// WITH_STDLIB
-// MODULE: m1-common
-// FILE: common.kt
-
-expect open class Base() {
- fun existingMethodInBase()
-}
-
-expect open class Foo : Base {
- fun existingMethod()
- val existingParam: Int
-}
-
-// MODULE: m2-jvm()()(m1-common)
-// FILE: jvm.kt
-
-actual typealias Base = BaseImpl
-
-open class BaseImpl {
- fun existingMethodInBase() {}
- fun injected() {}
-}
-
-actual open class Foo : Base() {
- actual fun existingMethod() {}
- actual val existingParam: Int = 904
-}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_supertypeIsActualTypealias_injectMethod.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_supertypeIsActualTypealias_injectMethod.kt
index dbcbdf4..3bd6f44 100644
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_supertypeIsActualTypealias_injectMethod.kt
+++ b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_supertypeIsActualTypealias_injectMethod.kt
@@ -1,3 +1,4 @@
+// FIR_IDENTICAL
// WITH_STDLIB
// MODULE: m1-common
// FILE: common.kt
@@ -14,7 +15,7 @@
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
-actual typealias <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>Base<!> = BaseImpl
+actual typealias Base = BaseImpl
open class BaseImpl {
fun existingMethodInBase() {}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_supertypeIsActualTypealias_injectMethod_transitiveSubstitutionFakeOverride.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_supertypeIsActualTypealias_injectMethod_transitiveSubstitutionFakeOverride.fir.kt
deleted file mode 100644
index c11b3f2..0000000
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_supertypeIsActualTypealias_injectMethod_transitiveSubstitutionFakeOverride.fir.kt
+++ /dev/null
@@ -1,29 +0,0 @@
-// WITH_STDLIB
-// MODULE: m1-common
-// FILE: common.kt
-
-expect open class Base<T>() {
- fun existingMethodInBase(param: T)
-}
-
-open class Transitive : Base<String>()
-
-expect open class Foo : Transitive {
- fun existingMethod()
- val existingParam: Int
-}
-
-// MODULE: m2-jvm()()(m1-common)
-// FILE: jvm.kt
-
-actual typealias Base<T> = BaseImpl<T>
-
-open class BaseImpl<T> {
- fun existingMethodInBase(param: T) {}
- fun injected() {}
-}
-
-actual open class Foo : Transitive() {
- actual fun existingMethod() {}
- actual val existingParam: Int = 904
-}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_supertypeIsActualTypealias_injectMethod_transitiveSubstitutionFakeOverride.kt b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_supertypeIsActualTypealias_injectMethod_transitiveSubstitutionFakeOverride.kt
index ca4db3a..ad67ce8 100644
--- a/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_supertypeIsActualTypealias_injectMethod_transitiveSubstitutionFakeOverride.kt
+++ b/compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_supertypeIsActualTypealias_injectMethod_transitiveSubstitutionFakeOverride.kt
@@ -1,3 +1,4 @@
+// FIR_IDENTICAL
// WITH_STDLIB
// MODULE: m1-common
// FILE: common.kt
@@ -16,7 +17,7 @@
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
-actual typealias <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>Base<!><T> = BaseImpl<T>
+actual typealias Base<T> = BaseImpl<T>
open class BaseImpl<T> {
fun existingMethodInBase(param: T) {}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/headerClass/genericClassImplTypeAlias.kt b/compiler/testData/diagnostics/tests/multiplatform/headerClass/genericClassImplTypeAlias.kt
index 03130c8..804c086 100644
--- a/compiler/testData/diagnostics/tests/multiplatform/headerClass/genericClassImplTypeAlias.kt
+++ b/compiler/testData/diagnostics/tests/multiplatform/headerClass/genericClassImplTypeAlias.kt
@@ -22,16 +22,16 @@
actual typealias C1 = String
<!ACTUAL_TYPE_ALIAS_TO_CLASS_WITH_DECLARATION_SITE_VARIANCE!>actual typealias C2<A> = List<String><!>
<!ACTUAL_TYPE_ALIAS_TO_CLASS_WITH_DECLARATION_SITE_VARIANCE!>actual typealias C3<B> = List<B><!>
-actual typealias <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>C4<!><D, E> = MutableMap<D, E>
-<!ACTUAL_TYPE_ALIAS_WITH_COMPLEX_SUBSTITUTION!>actual typealias <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>C5<!><F, G> = MutableMap<G, F><!>
+actual typealias C4<D, E> = MutableMap<D, E>
+<!ACTUAL_TYPE_ALIAS_WITH_COMPLEX_SUBSTITUTION!>actual typealias C5<F, G> = MutableMap<G, F><!>
<!ACTUAL_TYPE_ALIAS_WITH_COMPLEX_SUBSTITUTION!>actual typealias C51 = MutableMap<String, String><!>
<!ACTUAL_TYPE_ALIAS_WITH_COMPLEX_SUBSTITUTION!>actual typealias C52<F> = MutableMap<F, String><!>
<!ACTUAL_TYPE_ALIAS_WITH_COMPLEX_SUBSTITUTION!>actual typealias C53<T> = A<A<T>><!>
<!ACTUAL_TYPE_ALIAS_WITH_COMPLEX_SUBSTITUTION!>actual typealias C54<T> = B<List<String>><!>
-actual typealias <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>C6<!><H> = MutableList<H>
-<!ACTUAL_TYPE_ALIAS_WITH_USE_SITE_VARIANCE!>actual typealias <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>C7<!><I> = MutableList<out I><!>
-<!ACTUAL_TYPE_ALIAS_WITH_USE_SITE_VARIANCE!>actual typealias <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>C8<!><J> = MutableList<*><!>
-<!ACTUAL_TYPE_ALIAS_WITH_USE_SITE_VARIANCE!>actual typealias <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>C9<!><K> = MutableList<in K><!>
+actual typealias C6<H> = MutableList<H>
+<!ACTUAL_TYPE_ALIAS_WITH_USE_SITE_VARIANCE!>actual typealias C7<I> = MutableList<out I><!>
+<!ACTUAL_TYPE_ALIAS_WITH_USE_SITE_VARIANCE!>actual typealias C8<J> = MutableList<*><!>
+<!ACTUAL_TYPE_ALIAS_WITH_USE_SITE_VARIANCE!>actual typealias C9<K> = MutableList<in K><!>
typealias Tmp<K> = MutableList<K>
-<!ACTUAL_TYPE_ALIAS_NOT_TO_CLASS!>actual typealias <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>C10<!><L> = Tmp<L><!>
+<!ACTUAL_TYPE_ALIAS_NOT_TO_CLASS!>actual typealias C10<L> = Tmp<L><!>
diff --git a/compiler/testData/diagnostics/tests/multiplatform/hmpp/kt57320.kt b/compiler/testData/diagnostics/tests/multiplatform/hmpp/kt57320.kt
index 1e9540c..067ecb0 100644
--- a/compiler/testData/diagnostics/tests/multiplatform/hmpp/kt57320.kt
+++ b/compiler/testData/diagnostics/tests/multiplatform/hmpp/kt57320.kt
@@ -32,7 +32,7 @@
// TARGET_PLATFORM: JS
// FILE: StringDemoInterface.kt
-actual typealias <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>StringDemoInterface<!> = KotlinXStringDemoInterface
+actual typealias StringDemoInterface = KotlinXStringDemoInterface
actual fun StringDemoInterface.<!ACTUAL_WITHOUT_EXPECT("Actual function 'plusK'; The following declaration is incompatible because return type is different: public expect fun StringDemoInterface /* = KotlinXStringDemoInterface */.plusK(): String")!>plusK<!>() = <!RESOLUTION_TO_CLASSIFIER!>StringValue<!>(value).<!DEBUG_INFO_MISSING_UNRESOLVED!>plus<!>("K").<!DEBUG_INFO_MISSING_UNRESOLVED!>value<!>
diff --git a/compiler/testData/diagnostics/tests/multiplatform/hmpp/simple.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/hmpp/simple.fir.kt
deleted file mode 100644
index 152a332..0000000
--- a/compiler/testData/diagnostics/tests/multiplatform/hmpp/simple.fir.kt
+++ /dev/null
@@ -1,22 +0,0 @@
-
-// MODULE: common
-// TARGET_PLATFORM: Common
-expect open class A()
-
-// MODULE: intermediate()()(common)
-// TARGET_PLATFORM: Common
-class B : A() {
- fun foo(): String = "O"
-}
-
-fun getB(): B = B()
-
-// MODULE: main()()(intermediate)
-actual open class A actual constructor() {
- fun bar(): String = "K"
-}
-
-fun box(): String {
- val b = getB()
- return b.foo() + b.bar()
-}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/hmpp/simple.kt b/compiler/testData/diagnostics/tests/multiplatform/hmpp/simple.kt
index 392d13a..fd79eff 100644
--- a/compiler/testData/diagnostics/tests/multiplatform/hmpp/simple.kt
+++ b/compiler/testData/diagnostics/tests/multiplatform/hmpp/simple.kt
@@ -1,3 +1,4 @@
+// FIR_IDENTICAL
// MODULE: common
// TARGET_PLATFORM: Common
@@ -12,8 +13,8 @@
fun getB(): B = B()
// MODULE: main()()(intermediate)
-actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class A<!> actual constructor() {
- fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>bar<!>(): String = "K"
+actual open class A actual constructor() {
+ fun bar(): String = "K"
}
fun box(): String {
diff --git a/compiler/testData/diagnostics/tests/multiplatform/manyImplMemberNotImplemented.kt b/compiler/testData/diagnostics/tests/multiplatform/manyImplMemberNotImplemented.kt
index c6af35c..93f11e8 100644
--- a/compiler/testData/diagnostics/tests/multiplatform/manyImplMemberNotImplemented.kt
+++ b/compiler/testData/diagnostics/tests/multiplatform/manyImplMemberNotImplemented.kt
@@ -21,18 +21,18 @@
// TARGET_PLATFORM: JVM
// FILE: main.kt
-actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class C1<!> {
- fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>f<!>() {}
+actual open class C1 {
+ fun f() {}
}
-<!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>actual interface I1<!> {
- fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>f<!>() {}
+actual interface I1 {
+ fun f() {}
}
-actual abstract <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class C2<!> actual constructor() {
- fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>g<!>() {}
+actual abstract class C2 actual constructor() {
+ fun g() {}
}
-<!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>actual interface I2<!> {
- fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>g<!>()
+actual interface I2 {
+ fun g()
}
diff --git a/compiler/testData/diagnostics/tests/multiplatform/manyInterfacesMemberNotImplemented.kt b/compiler/testData/diagnostics/tests/multiplatform/manyInterfacesMemberNotImplemented.kt
index 26c1840..db8b3d8 100644
--- a/compiler/testData/diagnostics/tests/multiplatform/manyInterfacesMemberNotImplemented.kt
+++ b/compiler/testData/diagnostics/tests/multiplatform/manyInterfacesMemberNotImplemented.kt
@@ -16,10 +16,10 @@
// TARGET_PLATFORM: JVM
// FILE: main.kt
-<!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>actual interface S1<!> {
- fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>f<!>() {}
+actual interface S1 {
+ fun f() {}
}
-<!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>actual interface S2<!> {
- fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>f<!>() {}
+actual interface S2 {
+ fun f() {}
}
diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java
index ec95ce9..50a3f91 100644
--- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java
+++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java
@@ -23816,6 +23816,12 @@
}
@Test
+ @TestMetadata("overloadMethodInjectedInSuper.kt")
+ public void testOverloadMethodInjectedInSuper() throws Exception {
+ runTest("compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/overloadMethodInjectedInSuper.kt");
+ }
+
+ @Test
@TestMetadata("propertyKindOverride.kt")
public void testPropertyKindOverride() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/propertyKindOverride.kt");
diff --git a/core/compiler.common/src/org/jetbrains/kotlin/resolve/multiplatform/ExpectActualMemberDiff.kt b/core/compiler.common/src/org/jetbrains/kotlin/resolve/multiplatform/ExpectActualMemberDiff.kt
index 56dd256..1a02c185 100644
--- a/core/compiler.common/src/org/jetbrains/kotlin/resolve/multiplatform/ExpectActualMemberDiff.kt
+++ b/core/compiler.common/src/org/jetbrains/kotlin/resolve/multiplatform/ExpectActualMemberDiff.kt
@@ -13,10 +13,6 @@
* Also see: [toMemberDiffKind]
*/
enum class Kind(val rawMessage: String) {
- NonPrivateCallableAdded(
- "{0}: non-private member must be declared in both the actual class and the expect class. " +
- "This error happens because the expect class ''{1}'' is non-final"
- ),
ReturnTypeChangedInOverride(
"{0}: the return type of this member must be the same in the expect class and the actual class. " +
"This error happens because the expect class ''{1}'' is non-final"
@@ -61,14 +57,17 @@
}
fun ExpectActualCompatibility.Incompatible<*>.toMemberDiffKind(): ExpectActualMemberDiff.Kind? = when (this) {
- ExpectActualCompatibility.Incompatible.CallableKind -> ExpectActualMemberDiff.Kind.NonPrivateCallableAdded
- ExpectActualCompatibility.Incompatible.ParameterCount -> ExpectActualMemberDiff.Kind.NonPrivateCallableAdded
- ExpectActualCompatibility.Incompatible.ParameterShape -> ExpectActualMemberDiff.Kind.NonPrivateCallableAdded
- ExpectActualCompatibility.Incompatible.ParameterTypes -> ExpectActualMemberDiff.Kind.NonPrivateCallableAdded
+ ExpectActualCompatibility.Incompatible.CallableKind,
+ ExpectActualCompatibility.Incompatible.ParameterCount,
+ ExpectActualCompatibility.Incompatible.ParameterShape,
+ ExpectActualCompatibility.Incompatible.ParameterTypes,
+ ExpectActualCompatibility.Incompatible.FunctionTypeParameterCount,
+ ExpectActualCompatibility.Incompatible.FunctionTypeParameterUpperBounds,
+ // It's an awful API. It will be fixed in KT-62752
+ -> error("It's not allowed to call this function with receiver: $this")
+
ExpectActualCompatibility.Incompatible.ReturnType -> ExpectActualMemberDiff.Kind.ReturnTypeChangedInOverride
- ExpectActualCompatibility.Incompatible.FunctionTypeParameterCount -> ExpectActualMemberDiff.Kind.NonPrivateCallableAdded
ExpectActualCompatibility.Incompatible.ClassTypeParameterCount -> error("Not applicable because ExpectActualMemberDiff is about members")
- ExpectActualCompatibility.Incompatible.FunctionTypeParameterUpperBounds -> ExpectActualMemberDiff.Kind.NonPrivateCallableAdded
ExpectActualCompatibility.Incompatible.ClassTypeParameterUpperBounds -> error("Not applicable because ExpectActualMemberDiff is about members")
ExpectActualCompatibility.Incompatible.ActualFunctionWithDefaultParameters -> null // It's not possible to add default parameters in override
ExpectActualCompatibility.Incompatible.ClassKind -> error("Not applicable because ExpectActualMemberDiff is about members")