[FE 1.0] 2/2 Don't report a warning when new members are added to open expect actualization
^KT-62655 Fixed
This commit is contained in:
+6
@@ -652,6 +652,12 @@ public class FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated extends Abst
|
|||||||
runTest("compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/nestedExpectOpenClass.kt");
|
runTest("compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/nestedExpectOpenClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("overloadMethodInjectedInSuper.kt")
|
||||||
|
public void testOverloadMethodInjectedInSuper() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/overloadMethodInjectedInSuper.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("propertyKindOverride.kt")
|
@TestMetadata("propertyKindOverride.kt")
|
||||||
public void testPropertyKindOverride() throws Exception {
|
public void testPropertyKindOverride() throws Exception {
|
||||||
|
|||||||
+6
@@ -652,6 +652,12 @@ public class FirOldFrontendMPPDiagnosticsWithPsiTestGenerated extends AbstractFi
|
|||||||
runTest("compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/nestedExpectOpenClass.kt");
|
runTest("compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/nestedExpectOpenClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("overloadMethodInjectedInSuper.kt")
|
||||||
|
public void testOverloadMethodInjectedInSuper() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/overloadMethodInjectedInSuper.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("propertyKindOverride.kt")
|
@TestMetadata("propertyKindOverride.kt")
|
||||||
public void testPropertyKindOverride() throws Exception {
|
public void testPropertyKindOverride() throws Exception {
|
||||||
|
|||||||
@@ -840,8 +840,6 @@ public interface Errors {
|
|||||||
DiagnosticFactory3<KtClassLikeDeclaration, ClassifierDescriptorWithTypeParameters, Set<K1ExpectActualMemberDiff<CallableMemberDescriptor, ClassDescriptor>>, ClassDescriptor>
|
DiagnosticFactory3<KtClassLikeDeclaration, ClassifierDescriptorWithTypeParameters, Set<K1ExpectActualMemberDiff<CallableMemberDescriptor, ClassDescriptor>>, ClassDescriptor>
|
||||||
ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING =
|
ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING =
|
||||||
DiagnosticFactory3.create(WARNING, DECLARATION_NAME);
|
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>>
|
DiagnosticFactory1<KtCallableDeclaration, K1ExpectActualMemberDiff<CallableMemberDescriptor, ClassDescriptor>>
|
||||||
UNKNOWN_PROBLEM_DURING_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING = DiagnosticFactory1.create(WARNING, DECLARATION_NAME);
|
UNKNOWN_PROBLEM_DURING_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING = DiagnosticFactory1.create(WARNING, DECLARATION_NAME);
|
||||||
DiagnosticFactory1<KtCallableDeclaration, K1ExpectActualMemberDiff<CallableMemberDescriptor, ClassDescriptor>>
|
DiagnosticFactory1<KtCallableDeclaration, K1ExpectActualMemberDiff<CallableMemberDescriptor, ClassDescriptor>>
|
||||||
|
|||||||
-3
@@ -403,9 +403,6 @@ public class DefaultErrorMessages {
|
|||||||
CAPITALIZED_DECLARATION_NAME_WITH_KIND_AND_PLATFORM,
|
CAPITALIZED_DECLARATION_NAME_WITH_KIND_AND_PLATFORM,
|
||||||
ExpectActualScopeDiffsRenderer.TEXT,
|
ExpectActualScopeDiffsRenderer.TEXT,
|
||||||
NAME);
|
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,
|
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",
|
"{0}. This warning will become an error in future releases. Also see https://youtrack.jetbrains.com/issue/KT-22841 for more details",
|
||||||
ExpectActualScopeDiffRenderer.INSTANCE);
|
ExpectActualScopeDiffRenderer.INSTANCE);
|
||||||
|
|||||||
+12
-9
@@ -9,13 +9,8 @@ import org.jetbrains.kotlin.config.LanguageFeature
|
|||||||
import org.jetbrains.kotlin.descriptors.*
|
import org.jetbrains.kotlin.descriptors.*
|
||||||
import org.jetbrains.kotlin.diagnostics.Errors
|
import org.jetbrains.kotlin.diagnostics.Errors
|
||||||
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
|
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
|
||||||
import org.jetbrains.kotlin.name.FqName
|
|
||||||
import org.jetbrains.kotlin.psi.*
|
import org.jetbrains.kotlin.psi.*
|
||||||
import org.jetbrains.kotlin.resolve.BindingTrace
|
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.descriptorUtil.module
|
||||||
import org.jetbrains.kotlin.resolve.multiplatform.*
|
import org.jetbrains.kotlin.resolve.multiplatform.*
|
||||||
import org.jetbrains.kotlin.resolve.scopes.MemberScope
|
import org.jetbrains.kotlin.resolve.scopes.MemberScope
|
||||||
@@ -130,7 +125,7 @@ private fun calculateExpectActualScopeDiff(
|
|||||||
return actualClassCallables.flatMap { actualMember ->
|
return actualClassCallables.flatMap { actualMember ->
|
||||||
val potentialExpects = nameAndKindToExpectCallables[actualMember.name to actualMember.functionVsPropertyKind]
|
val potentialExpects = nameAndKindToExpectCallables[actualMember.name to actualMember.functionVsPropertyKind]
|
||||||
if (potentialExpects.isNullOrEmpty()) {
|
if (potentialExpects.isNullOrEmpty()) {
|
||||||
listOf(K1ExpectActualMemberDiff.Kind.NonPrivateCallableAdded)
|
emptyList<K1ExpectActualMemberDiff.Kind>()
|
||||||
} else {
|
} else {
|
||||||
potentialExpects
|
potentialExpects
|
||||||
.map { expectMember ->
|
.map { expectMember ->
|
||||||
@@ -145,9 +140,19 @@ private fun calculateExpectActualScopeDiff(
|
|||||||
}
|
}
|
||||||
.takeIf { kinds -> kinds.all { it != K1ExpectActualCompatibility.Compatible } }
|
.takeIf { kinds -> kinds.all { it != K1ExpectActualCompatibility.Compatible } }
|
||||||
.orEmpty()
|
.orEmpty()
|
||||||
.map {
|
.mapNotNull {
|
||||||
when (it) {
|
when (it) {
|
||||||
is K1ExpectActualCompatibility.Compatible -> error("Compatible was filtered out by takeIf")
|
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()
|
is K1ExpectActualCompatibility.Incompatible -> it.toMemberDiffKind()
|
||||||
// If toMemberDiffKind returns null then some Kotlin invariants described in toMemberDiffKind no longer hold.
|
// 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.
|
// We can't throw exception here because it would crash the compilation.
|
||||||
@@ -184,8 +189,6 @@ private val CallableMemberDescriptor.psiIfReal: KtCallableDeclaration?
|
|||||||
private fun BindingTrace.reportIfPossible(diff: K1ExpectActualMemberDiff<CallableMemberDescriptor, ClassDescriptor>) {
|
private fun BindingTrace.reportIfPossible(diff: K1ExpectActualMemberDiff<CallableMemberDescriptor, ClassDescriptor>) {
|
||||||
val psi = diff.actualMember.psiIfReal ?: return
|
val psi = diff.actualMember.psiIfReal ?: return
|
||||||
val diagnostic = when (diff.kind) {
|
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 ->
|
K1ExpectActualMemberDiff.Kind.ReturnTypeChangedInOverride ->
|
||||||
Errors.RETURN_TYPE_CHANGED_IN_NON_FINAL_EXPECT_CLASSIFIER_ACTUALIZATION_WARNING.on(psi, diff)
|
Errors.RETURN_TYPE_CHANGED_IN_NON_FINAL_EXPECT_CLASSIFIER_ACTUALIZATION_WARNING.on(psi, diff)
|
||||||
K1ExpectActualMemberDiff.Kind.ModalityChangedInOverride ->
|
K1ExpectActualMemberDiff.Kind.ModalityChangedInOverride ->
|
||||||
|
|||||||
+11
-10
@@ -13,10 +13,6 @@ data class K1ExpectActualMemberDiff<out M, out C>(val kind: Kind, val actualMemb
|
|||||||
* Also see: [toMemberDiffKind]
|
* Also see: [toMemberDiffKind]
|
||||||
*/
|
*/
|
||||||
enum class Kind(val rawMessage: String) {
|
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(
|
ReturnTypeChangedInOverride(
|
||||||
"{0}: the return type of this member must be the same in the expect class and the actual class. " +
|
"{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"
|
"This error happens because the expect class ''{1}'' is non-final"
|
||||||
@@ -61,14 +57,19 @@ data class K1ExpectActualMemberDiff<out M, out C>(val kind: Kind, val actualMemb
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun K1ExpectActualCompatibility.Incompatible<*>.toMemberDiffKind(): K1ExpectActualMemberDiff.Kind? = when (this) {
|
fun K1ExpectActualCompatibility.Incompatible<*>.toMemberDiffKind(): K1ExpectActualMemberDiff.Kind? = when (this) {
|
||||||
K1ExpectActualCompatibility.Incompatible.CallableKind -> K1ExpectActualMemberDiff.Kind.NonPrivateCallableAdded
|
K1ExpectActualCompatibility.Incompatible.CallableKind,
|
||||||
K1ExpectActualCompatibility.Incompatible.ParameterCount -> K1ExpectActualMemberDiff.Kind.NonPrivateCallableAdded
|
K1ExpectActualCompatibility.Incompatible.ParameterCount,
|
||||||
K1ExpectActualCompatibility.Incompatible.ParameterShape -> K1ExpectActualMemberDiff.Kind.NonPrivateCallableAdded
|
K1ExpectActualCompatibility.Incompatible.ParameterShape,
|
||||||
K1ExpectActualCompatibility.Incompatible.ParameterTypes -> K1ExpectActualMemberDiff.Kind.NonPrivateCallableAdded
|
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.ReturnType -> K1ExpectActualMemberDiff.Kind.ReturnTypeChangedInOverride
|
||||||
K1ExpectActualCompatibility.Incompatible.FunctionTypeParameterCount -> K1ExpectActualMemberDiff.Kind.NonPrivateCallableAdded
|
|
||||||
K1ExpectActualCompatibility.Incompatible.ClassTypeParameterCount -> error("Not applicable because K1ExpectActualMemberDiff is about members")
|
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.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.ActualFunctionWithDefaultParameters -> null // It's not possible to add default parameters in override
|
||||||
K1ExpectActualCompatibility.Incompatible.ClassKind -> error("Not applicable because K1ExpectActualMemberDiff is about members")
|
K1ExpectActualCompatibility.Incompatible.ClassKind -> error("Not applicable because K1ExpectActualMemberDiff is about members")
|
||||||
|
|||||||
-19
@@ -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
|
|
||||||
}
|
|
||||||
+3
-2
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// MODULE: m1-common
|
// MODULE: m1-common
|
||||||
// FILE: common.kt
|
// FILE: common.kt
|
||||||
|
|
||||||
@@ -9,11 +10,11 @@ expect open class Foo {
|
|||||||
// MODULE: m2-jvm()()(m1-common)
|
// MODULE: m2-jvm()()(m1-common)
|
||||||
// FILE: jvm.kt
|
// 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 {
|
open class FooImpl {
|
||||||
fun existingMethod() {}
|
fun existingMethod() {}
|
||||||
val existingParam: Int = 904
|
val existingParam: Int = 904
|
||||||
|
|
||||||
fun injectedMethod() {} // accidential override can happen with this injected fun. That's why it's prohibited
|
fun injectedMethod() {}
|
||||||
}
|
}
|
||||||
|
|||||||
-15
@@ -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
|
|
||||||
}
|
|
||||||
+3
-2
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// MODULE: m1-common
|
// MODULE: m1-common
|
||||||
// FILE: common.kt
|
// FILE: common.kt
|
||||||
|
|
||||||
@@ -8,8 +9,8 @@ expect open class Foo {
|
|||||||
// MODULE: m2-jvm()()(m1-common)
|
// MODULE: m2-jvm()()(m1-common)
|
||||||
// FILE: jvm.kt
|
// 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() {}
|
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() {}
|
||||||
}
|
}
|
||||||
|
|||||||
-15
@@ -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) {}
|
|
||||||
}
|
|
||||||
+3
-2
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// MODULE: m1-common
|
// MODULE: m1-common
|
||||||
// FILE: common.kt
|
// FILE: common.kt
|
||||||
|
|
||||||
@@ -10,6 +11,6 @@ expect open class Foo : Base
|
|||||||
// MODULE: m2-jvm()()(m1-common)
|
// MODULE: m2-jvm()()(m1-common)
|
||||||
// FILE: jvm.kt
|
// FILE: jvm.kt
|
||||||
|
|
||||||
actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Foo<!> : Base() {
|
actual open class Foo : Base() {
|
||||||
fun <T : Comparable<T>> <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>foo<!>(t: T) {}
|
fun <T : Comparable<T>> foo(t: T) {}
|
||||||
}
|
}
|
||||||
|
|||||||
-17
@@ -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
|
|
||||||
}
|
|
||||||
+3
-2
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// MODULE: m1-common
|
// MODULE: m1-common
|
||||||
// FILE: common.kt
|
// FILE: common.kt
|
||||||
|
|
||||||
@@ -9,9 +10,9 @@ expect open class Foo {
|
|||||||
// MODULE: m2-jvm()()(m1-common)
|
// MODULE: m2-jvm()()(m1-common)
|
||||||
// FILE: jvm.kt
|
// 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 fun existingMethod() {}
|
||||||
actual val existingParam: Int = 904
|
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() {}
|
||||||
}
|
}
|
||||||
|
|||||||
-17
@@ -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
|
|
||||||
}
|
|
||||||
+3
-2
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// MODULE: m1-common
|
// MODULE: m1-common
|
||||||
// FILE: common.kt
|
// FILE: common.kt
|
||||||
|
|
||||||
@@ -9,9 +10,9 @@ expect open class Foo {
|
|||||||
// MODULE: m2-jvm()()(m1-common)
|
// MODULE: m2-jvm()()(m1-common)
|
||||||
// FILE: jvm.kt
|
// 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 fun existingMethod() {}
|
||||||
actual val existingParam: Int = 904
|
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() {}
|
||||||
}
|
}
|
||||||
|
|||||||
-17
@@ -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
|
|
||||||
}
|
|
||||||
+3
-2
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// MODULE: m1-common
|
// MODULE: m1-common
|
||||||
// FILE: common.kt
|
// FILE: common.kt
|
||||||
|
|
||||||
@@ -9,9 +10,9 @@ expect open class Foo {
|
|||||||
// MODULE: m2-jvm()()(m1-common)
|
// MODULE: m2-jvm()()(m1-common)
|
||||||
// FILE: jvm.kt
|
// 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 fun existingMethod() {}
|
||||||
actual val existingParam: Int = 904
|
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() {}
|
||||||
}
|
}
|
||||||
|
|||||||
-19
@@ -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() {}
|
|
||||||
}
|
|
||||||
+2
-1
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// MODULE: m1-common
|
// MODULE: m1-common
|
||||||
// FILE: common.kt
|
// FILE: common.kt
|
||||||
|
|
||||||
@@ -8,7 +9,7 @@ expect open class Foo {
|
|||||||
// MODULE: m2-jvm()()(m1-common)
|
// MODULE: m2-jvm()()(m1-common)
|
||||||
// FILE: jvm.kt
|
// 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
|
// FILE: Foo.java
|
||||||
|
|
||||||
|
|||||||
-15
@@ -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
|
|
||||||
}
|
|
||||||
+3
-2
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// MODULE: m1-common
|
// MODULE: m1-common
|
||||||
// FILE: common.kt
|
// FILE: common.kt
|
||||||
|
|
||||||
@@ -8,8 +9,8 @@ expect open class Foo {
|
|||||||
// MODULE: m2-jvm()()(m1-common)
|
// MODULE: m2-jvm()()(m1-common)
|
||||||
// FILE: jvm.kt
|
// 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() {}
|
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) {}
|
||||||
}
|
}
|
||||||
|
|||||||
-15
@@ -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) {}
|
|
||||||
}
|
|
||||||
+3
-2
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// MODULE: m1-common
|
// MODULE: m1-common
|
||||||
// FILE: common.kt
|
// FILE: common.kt
|
||||||
|
|
||||||
@@ -10,6 +11,6 @@ expect open class Foo<R> : Base<R>
|
|||||||
// MODULE: m2-jvm()()(m1-common)
|
// MODULE: m2-jvm()()(m1-common)
|
||||||
// FILE: jvm.kt
|
// FILE: jvm.kt
|
||||||
|
|
||||||
actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Foo<!><R>() : Base<R>() {
|
actual open class Foo<R>() : Base<R>() {
|
||||||
fun <T> <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>foo<!>(t: T) {}
|
fun <T> foo(t: T) {}
|
||||||
}
|
}
|
||||||
|
|||||||
-17
@@ -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
|
|
||||||
}
|
|
||||||
+3
-2
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// MODULE: m1-common
|
// MODULE: m1-common
|
||||||
// FILE: common.kt
|
// FILE: common.kt
|
||||||
|
|
||||||
@@ -9,9 +10,9 @@ expect open class Foo {
|
|||||||
// MODULE: m2-jvm()()(m1-common)
|
// MODULE: m2-jvm()()(m1-common)
|
||||||
// FILE: jvm.kt
|
// 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 fun existingFun() {}
|
||||||
actual val existingParam: Int = 904
|
actual val existingParam: Int = 904
|
||||||
|
|
||||||
val <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>injectedProperty<!> = 1
|
val injectedProperty = 1
|
||||||
}
|
}
|
||||||
|
|||||||
-15
@@ -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
|
|
||||||
}
|
|
||||||
+3
-2
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// MODULE: m1-common
|
// MODULE: m1-common
|
||||||
// FILE: common.kt
|
// FILE: common.kt
|
||||||
|
|
||||||
@@ -8,8 +9,8 @@ expect open class Foo {
|
|||||||
// MODULE: m2-jvm()()(m1-common)
|
// MODULE: m2-jvm()()(m1-common)
|
||||||
// FILE: jvm.kt
|
// 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
|
actual fun foo(): Int = 904
|
||||||
|
|
||||||
val <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>foo<!>: Int = 42
|
val foo: Int = 42
|
||||||
}
|
}
|
||||||
|
|||||||
-15
@@ -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
|
|
||||||
}
|
|
||||||
+3
-2
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// MODULE: m1-common
|
// MODULE: m1-common
|
||||||
// FILE: common.kt
|
// FILE: common.kt
|
||||||
|
|
||||||
@@ -10,6 +11,6 @@ expect open class Foo : Base
|
|||||||
// MODULE: m2-jvm()()(m1-common)
|
// MODULE: m2-jvm()()(m1-common)
|
||||||
// FILE: jvm.kt
|
// FILE: jvm.kt
|
||||||
|
|
||||||
actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Foo<!> : Base() {
|
actual open class Foo : Base() {
|
||||||
open fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>foo<!>(vararg t: String) {} // injected
|
open fun foo(vararg t: String) {} // injected
|
||||||
}
|
}
|
||||||
|
|||||||
-14
@@ -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) {}
|
|
||||||
}
|
|
||||||
+3
-2
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// MODULE: m1-common
|
// MODULE: m1-common
|
||||||
// FILE: common.kt
|
// FILE: common.kt
|
||||||
|
|
||||||
@@ -8,7 +9,7 @@ expect open class Foo {
|
|||||||
// MODULE: m2-jvm()()(m1-common)
|
// MODULE: m2-jvm()()(m1-common)
|
||||||
// FILE: jvm.kt
|
// 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) {}
|
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) {}
|
||||||
}
|
}
|
||||||
|
|||||||
-22
@@ -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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+3
-2
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// MODULE: m1-common
|
// MODULE: m1-common
|
||||||
// FILE: common.kt
|
// FILE: common.kt
|
||||||
|
|
||||||
@@ -13,10 +14,10 @@ expect class Outer {
|
|||||||
// FILE: jvm.kt
|
// FILE: jvm.kt
|
||||||
|
|
||||||
actual class Outer {
|
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 fun existingMethod() {}
|
||||||
actual val existingParam: Int = 904
|
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() {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+21
@@ -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) {}
|
||||||
|
}
|
||||||
+21
@@ -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) {}
|
||||||
|
}
|
||||||
+2
-2
@@ -20,8 +20,8 @@ actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_C
|
|||||||
actual fun existingMethod() {}
|
actual fun existingMethod() {}
|
||||||
actual val existingParam: Int = 904
|
actual val existingParam: Int = 904
|
||||||
|
|
||||||
fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>injectedMethod<!>() {}
|
fun injectedMethod() {}
|
||||||
val <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>injectedProperty<!>: Int = 42
|
val injectedProperty: Int = 42
|
||||||
override fun overrideReturnType(): <!RETURN_TYPE_CHANGED_IN_NON_FINAL_EXPECT_CLASSIFIER_ACTUALIZATION_WARNING!>String<!> = ""
|
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 overrideModality1(): Any = ""
|
||||||
<!MODALITY_CHANGED_IN_NON_FINAL_EXPECT_CLASSIFIER_ACTUALIZATION_WARNING!>final<!> override fun overrideModality2(): Any = ""
|
<!MODALITY_CHANGED_IN_NON_FINAL_EXPECT_CLASSIFIER_ACTUALIZATION_WARNING!>final<!> override fun overrideModality2(): Any = ""
|
||||||
|
|||||||
+2
-2
@@ -14,9 +14,9 @@ expect open class Foo : Base {
|
|||||||
// MODULE: m2-jvm()()(m1-common)
|
// MODULE: m2-jvm()()(m1-common)
|
||||||
// FILE: jvm.kt
|
// 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() {}
|
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() {
|
actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Foo<!> : Base() {
|
||||||
|
|||||||
+2
-2
@@ -16,9 +16,9 @@ expect open class Foo : Transitive {
|
|||||||
// MODULE: m2-jvm()()(m1-common)
|
// MODULE: m2-jvm()()(m1-common)
|
||||||
// FILE: jvm.kt
|
// 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) {}
|
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() {
|
actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Foo<!> : Transitive() {
|
||||||
|
|||||||
-25
@@ -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
|
|
||||||
}
|
|
||||||
+3
-2
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// WITH_STDLIB
|
// WITH_STDLIB
|
||||||
// MODULE: m1-common
|
// MODULE: m1-common
|
||||||
// FILE: common.kt
|
// FILE: common.kt
|
||||||
@@ -14,9 +15,9 @@ expect open class Foo : Base {
|
|||||||
// MODULE: m2-jvm()()(m1-common)
|
// MODULE: m2-jvm()()(m1-common)
|
||||||
// FILE: jvm.kt
|
// 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() {}
|
actual fun existingMethodInBase() {}
|
||||||
fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>injected<!>() {}
|
fun injected() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
actual open class Foo : Base() {
|
actual open class Foo : Base() {
|
||||||
|
|||||||
-27
@@ -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
|
|
||||||
}
|
|
||||||
+3
-2
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// WITH_STDLIB
|
// WITH_STDLIB
|
||||||
// MODULE: m1-common
|
// MODULE: m1-common
|
||||||
// FILE: common.kt
|
// FILE: common.kt
|
||||||
@@ -16,9 +17,9 @@ expect open class Foo : Transitive {
|
|||||||
// MODULE: m2-jvm()()(m1-common)
|
// MODULE: m2-jvm()()(m1-common)
|
||||||
// FILE: jvm.kt
|
// 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) {}
|
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() {
|
actual open class Foo : Transitive() {
|
||||||
|
|||||||
-27
@@ -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
|
|
||||||
}
|
|
||||||
+2
-1
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// WITH_STDLIB
|
// WITH_STDLIB
|
||||||
// MODULE: m1-common
|
// MODULE: m1-common
|
||||||
// FILE: common.kt
|
// FILE: common.kt
|
||||||
@@ -14,7 +15,7 @@ expect open class Foo : Base {
|
|||||||
// MODULE: m2-jvm()()(m1-common)
|
// MODULE: m2-jvm()()(m1-common)
|
||||||
// FILE: jvm.kt
|
// 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 {
|
open class BaseImpl {
|
||||||
fun existingMethodInBase() {}
|
fun existingMethodInBase() {}
|
||||||
|
|||||||
-29
@@ -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
|
|
||||||
}
|
|
||||||
+2
-1
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// WITH_STDLIB
|
// WITH_STDLIB
|
||||||
// MODULE: m1-common
|
// MODULE: m1-common
|
||||||
// FILE: common.kt
|
// FILE: common.kt
|
||||||
@@ -16,7 +17,7 @@ expect open class Foo : Transitive {
|
|||||||
// MODULE: m2-jvm()()(m1-common)
|
// MODULE: m2-jvm()()(m1-common)
|
||||||
// FILE: jvm.kt
|
// 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> {
|
open class BaseImpl<T> {
|
||||||
fun existingMethodInBase(param: T) {}
|
fun existingMethodInBase(param: T) {}
|
||||||
|
|||||||
+7
-7
@@ -22,16 +22,16 @@ class B<T>
|
|||||||
actual typealias C1 = String
|
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 C2<A> = List<String><!>
|
||||||
<!ACTUAL_TYPE_ALIAS_TO_CLASS_WITH_DECLARATION_SITE_VARIANCE!>actual typealias C3<B> = List<B><!>
|
<!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 typealias 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_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 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 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 C53<T> = A<A<T>><!>
|
||||||
<!ACTUAL_TYPE_ALIAS_WITH_COMPLEX_SUBSTITUTION!>actual typealias C54<T> = B<List<String>><!>
|
<!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 typealias 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 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 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_TYPE_ALIAS_WITH_USE_SITE_VARIANCE!>actual typealias C9<K> = MutableList<in K><!>
|
||||||
|
|
||||||
typealias Tmp<K> = MutableList<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><!>
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ expect fun StringDemoInterface.plusK(): <!NO_ACTUAL_FOR_EXPECT{JS}!>String<!>
|
|||||||
// TARGET_PLATFORM: JS
|
// TARGET_PLATFORM: JS
|
||||||
|
|
||||||
// FILE: StringDemoInterface.kt
|
// 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<!>
|
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<!>
|
||||||
|
|
||||||
|
|||||||
@@ -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()
|
|
||||||
}
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
|
|
||||||
// MODULE: common
|
// MODULE: common
|
||||||
// TARGET_PLATFORM: Common
|
// TARGET_PLATFORM: Common
|
||||||
@@ -12,8 +13,8 @@ class B : A() {
|
|||||||
fun getB(): B = B()
|
fun getB(): B = B()
|
||||||
|
|
||||||
// MODULE: main()()(intermediate)
|
// MODULE: main()()(intermediate)
|
||||||
actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class A<!> actual constructor() {
|
actual open class A actual constructor() {
|
||||||
fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>bar<!>(): String = "K"
|
fun bar(): String = "K"
|
||||||
}
|
}
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
|
|||||||
+8
-8
@@ -21,18 +21,18 @@ class C : C2(), I2
|
|||||||
// TARGET_PLATFORM: JVM
|
// TARGET_PLATFORM: JVM
|
||||||
// FILE: main.kt
|
// FILE: main.kt
|
||||||
|
|
||||||
actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class C1<!> {
|
actual open class C1 {
|
||||||
fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>f<!>() {}
|
fun f() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
<!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>actual interface I1<!> {
|
actual interface I1 {
|
||||||
fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>f<!>() {}
|
fun f() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
actual abstract <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class C2<!> actual constructor() {
|
actual abstract class C2 actual constructor() {
|
||||||
fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>g<!>() {}
|
fun g() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
<!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>actual interface I2<!> {
|
actual interface I2 {
|
||||||
fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>g<!>()
|
fun g()
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -16,10 +16,10 @@ class B : A()
|
|||||||
// TARGET_PLATFORM: JVM
|
// TARGET_PLATFORM: JVM
|
||||||
// FILE: main.kt
|
// FILE: main.kt
|
||||||
|
|
||||||
<!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>actual interface S1<!> {
|
actual interface S1 {
|
||||||
fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>f<!>() {}
|
fun f() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
<!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>actual interface S2<!> {
|
actual interface S2 {
|
||||||
fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>f<!>() {}
|
fun f() {}
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+6
@@ -23899,6 +23899,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/nestedExpectOpenClass.kt");
|
runTest("compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/nestedExpectOpenClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("overloadMethodInjectedInSuper.kt")
|
||||||
|
public void testOverloadMethodInjectedInSuper() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/overloadMethodInjectedInSuper.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("propertyKindOverride.kt")
|
@TestMetadata("propertyKindOverride.kt")
|
||||||
public void testPropertyKindOverride() throws Exception {
|
public void testPropertyKindOverride() throws Exception {
|
||||||
|
|||||||
+9
-10
@@ -13,10 +13,6 @@ data class ExpectActualMemberDiff<out M, out C>(val kind: Kind, val actualMember
|
|||||||
* Also see: [toMemberDiffKind]
|
* Also see: [toMemberDiffKind]
|
||||||
*/
|
*/
|
||||||
enum class Kind(val rawMessage: String) {
|
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(
|
ReturnTypeChangedInOverride(
|
||||||
"{0}: the return type of this member must be the same in the expect class and the actual class. " +
|
"{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"
|
"This error happens because the expect class ''{1}'' is non-final"
|
||||||
@@ -61,14 +57,17 @@ data class ExpectActualMemberDiff<out M, out C>(val kind: Kind, val actualMember
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun ExpectActualCompatibility.Incompatible<*>.toMemberDiffKind(): ExpectActualMemberDiff.Kind? = when (this) {
|
fun ExpectActualCompatibility.Incompatible<*>.toMemberDiffKind(): ExpectActualMemberDiff.Kind? = when (this) {
|
||||||
ExpectActualCompatibility.Incompatible.CallableKind -> ExpectActualMemberDiff.Kind.NonPrivateCallableAdded
|
ExpectActualCompatibility.Incompatible.CallableKind,
|
||||||
ExpectActualCompatibility.Incompatible.ParameterCount -> ExpectActualMemberDiff.Kind.NonPrivateCallableAdded
|
ExpectActualCompatibility.Incompatible.ParameterCount,
|
||||||
ExpectActualCompatibility.Incompatible.ParameterShape -> ExpectActualMemberDiff.Kind.NonPrivateCallableAdded
|
ExpectActualCompatibility.Incompatible.ParameterShape,
|
||||||
ExpectActualCompatibility.Incompatible.ParameterTypes -> ExpectActualMemberDiff.Kind.NonPrivateCallableAdded
|
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.ReturnType -> ExpectActualMemberDiff.Kind.ReturnTypeChangedInOverride
|
||||||
ExpectActualCompatibility.Incompatible.FunctionTypeParameterCount -> ExpectActualMemberDiff.Kind.NonPrivateCallableAdded
|
|
||||||
ExpectActualCompatibility.Incompatible.ClassTypeParameterCount -> error("Not applicable because ExpectActualMemberDiff is about members")
|
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.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.ActualFunctionWithDefaultParameters -> null // It's not possible to add default parameters in override
|
||||||
ExpectActualCompatibility.Incompatible.ClassKind -> error("Not applicable because ExpectActualMemberDiff is about members")
|
ExpectActualCompatibility.Incompatible.ClassKind -> error("Not applicable because ExpectActualMemberDiff is about members")
|
||||||
|
|||||||
Reference in New Issue
Block a user