Skip to content

Commit 6982fa1

Browse files
nikitabobkoSpace Team
authored and
Space Team
committed
[FE 1.0] 2/2 Drop AllowDifferentMembersInActual from compiler and testData
The annotation was dropped in the previous commit
1 parent 882f468 commit 6982fa1

File tree

25 files changed

+119
-136
lines changed

25 files changed

+119
-136
lines changed

compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated.java

Lines changed: 0 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithPsiTestGenerated.java

Lines changed: 0 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/ActualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker.kt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ private fun checkExpectActualScopeDiff(
8686
}
8787
}
8888

89-
private val allowDifferentMembersInActualFqn = FqName("kotlin.AllowDifferentMembersInActual")
90-
9189
@OptIn(ExperimentalContracts::class)
9290
internal fun matchActualWithNonFinalExpect(
9391
declaration: KtDeclaration,
@@ -110,10 +108,6 @@ internal fun matchActualWithNonFinalExpect(
110108

111109
if (!descriptor.isActual) return null
112110

113-
with(OptInUsageChecker) {
114-
if (declaration.isDeclarationAnnotatedWith(allowDifferentMembersInActualFqn, context.trace.bindingContext)) return null
115-
}
116-
117111
val actual = when (descriptor) {
118112
is ClassDescriptor -> descriptor
119113
is TypeAliasDescriptor -> descriptor.classDescriptor

compiler/testData/codegen/box/multiplatform/defaultArguments/bothInExpectAndActual2.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ actual interface I {
2121
actual fun test(source: String = "actual")
2222
}
2323

24-
@OptIn(ExperimentalMultiplatform::class)
25-
@AllowDifferentMembersInActual
2624
actual interface J : I {
2725
override fun test(source: String) {
2826
if (source != "actual") throw AssertionError(source)

compiler/testData/codegen/box/multiplatform/hmpp/simple.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ fun getB(): B = B()
2626

2727
// MODULE: main()()(intermediate)
2828
// FILE: main.kt
29-
@OptIn(ExperimentalMultiplatform::class)
30-
@AllowDifferentMembersInActual
3129
actual open class A actual constructor() {
3230
fun bar(): String = "K"
3331
}

compiler/testData/codegen/box/multiplatform/k2/basic/expectInterfaceInSupertypes.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,12 @@ class B : A()
1818
// MODULE: platform()()(common)
1919
// FILE: platform.kt
2020

21-
@OptIn(ExperimentalMultiplatform::class)
22-
@AllowDifferentMembersInActual
2321
actual interface S1 {
2422
fun o(): S = "O"
2523
val p: Boolean
2624
get() = true
2725
}
2826

29-
@OptIn(ExperimentalMultiplatform::class)
30-
@AllowDifferentMembersInActual
3127
actual interface S2 {
3228
fun k() = "K"
3329
}

compiler/testData/codegen/box/multiplatform/k2/basic/expectInterfaceInSupertypes2.kt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ class B : A()
1818
// MODULE: platform()()(common)
1919
// FILE: platform.kt
2020

21-
@OptIn(ExperimentalMultiplatform::class)
22-
@AllowDifferentMembersInActual
2321
actual interface S1 {
2422
fun s1() = "O"
2523
}
@@ -28,13 +26,9 @@ interface S20 {
2826
fun s2() = "K"
2927
}
3028

31-
@OptIn(ExperimentalMultiplatform::class)
32-
@AllowDifferentMembersInActual
3329
actual interface S2 : S20 {
3430
}
3531

36-
@OptIn(ExperimentalMultiplatform::class)
37-
@AllowDifferentMembersInActual
3832
actual interface S : S1, S2 {
3933
fun s3() = s1() + s2()
4034
}

compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/allowDifferentMembersInActual_class.kt

Lines changed: 0 additions & 21 deletions
This file was deleted.

compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/allowDifferentMembersInActual_typealias.kt

Lines changed: 0 additions & 23 deletions
This file was deleted.

compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_covariantOverrideOfInjectedFromSuper.fir.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ expect open class Foo : Base {
1414
// MODULE: m2-jvm()()(m1-common)
1515
// FILE: jvm.kt
1616

17-
@OptIn(ExperimentalMultiplatform::class)
18-
@AllowDifferentMembersInActual
1917
actual open class Base {
2018
actual fun existingMethodInBase() {}
2119
open fun injected(): Any = ""

compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_covariantOverrideOfInjectedFromSuper.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@ expect open class Foo : Base {
1414
// MODULE: m2-jvm()()(m1-common)
1515
// FILE: jvm.kt
1616

17-
@OptIn(ExperimentalMultiplatform::class)
18-
@AllowDifferentMembersInActual
19-
actual open class Base {
17+
actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Base<!> {
2018
actual fun existingMethodInBase() {}
21-
open fun injected(): Any = ""
19+
open fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>injected<!>(): Any = ""
2220
}
2321

2422
actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Foo<!> : Base() {

compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_covariantOverrideOfInjectedFromSuper_transitiveSubstitutionFakeOverride.fir.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ expect open class Foo : Transitive {
1616
// MODULE: m2-jvm()()(m1-common)
1717
// FILE: jvm.kt
1818

19-
@OptIn(ExperimentalMultiplatform::class)
20-
@AllowDifferentMembersInActual
2119
actual open class Base<T> {
2220
actual fun existingMethodInBase(param: T) {}
2321
open fun injected(param: T): Any = ""

compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_covariantOverrideOfInjectedFromSuper_transitiveSubstitutionFakeOverride.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@ expect open class Foo : Transitive {
1616
// MODULE: m2-jvm()()(m1-common)
1717
// FILE: jvm.kt
1818

19-
@OptIn(ExperimentalMultiplatform::class)
20-
@AllowDifferentMembersInActual
21-
actual open class Base<T> {
19+
actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Base<!><T> {
2220
actual fun existingMethodInBase(param: T) {}
23-
open fun injected(param: T): Any = ""
21+
open fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>injected<!>(param: T): Any = ""
2422
}
2523

2624
actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Foo<!> : Transitive() {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// WITH_STDLIB
2+
// MODULE: m1-common
3+
// FILE: common.kt
4+
5+
expect open class Base {
6+
fun existingMethodInBase()
7+
}
8+
9+
expect open class Foo : Base {
10+
fun existingMethod()
11+
val existingParam: Int
12+
}
13+
14+
// MODULE: m2-jvm()()(m1-common)
15+
// FILE: jvm.kt
16+
17+
actual open class Base {
18+
actual fun existingMethodInBase() {}
19+
fun injected() {}
20+
}
21+
22+
actual open class Foo : Base() {
23+
actual fun existingMethod() {}
24+
actual val existingParam: Int = 904
25+
}

compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_injectMethod.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// FIR_IDENTICAL
21
// WITH_STDLIB
32
// MODULE: m1-common
43
// FILE: common.kt
@@ -15,11 +14,9 @@ expect open class Foo : Base {
1514
// MODULE: m2-jvm()()(m1-common)
1615
// FILE: jvm.kt
1716

18-
@OptIn(ExperimentalMultiplatform::class)
19-
@AllowDifferentMembersInActual
20-
actual open class Base {
17+
actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Base<!> {
2118
actual fun existingMethodInBase() {}
22-
fun injected() {}
19+
fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>injected<!>() {}
2320
}
2421

2522
actual open class Foo : Base() {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// WITH_STDLIB
2+
// MODULE: m1-common
3+
// FILE: common.kt
4+
5+
expect open class Base<T>() {
6+
fun existingMethodInBase(param: T)
7+
}
8+
9+
open class Transitive : Base<String>()
10+
11+
expect open class Foo : Transitive {
12+
fun existingMethod()
13+
val existingParam: Int
14+
}
15+
16+
// MODULE: m2-jvm()()(m1-common)
17+
// FILE: jvm.kt
18+
19+
actual open class Base<T> {
20+
actual fun existingMethodInBase(param: T) {}
21+
fun injected() {}
22+
}
23+
24+
actual open class Foo : Transitive() {
25+
actual fun existingMethod() {}
26+
actual val existingParam: Int = 904
27+
}

compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_injectMethod_transitiveSubstitutionFakeOverride.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// FIR_IDENTICAL
21
// WITH_STDLIB
32
// MODULE: m1-common
43
// FILE: common.kt
@@ -17,11 +16,9 @@ expect open class Foo : Transitive {
1716
// MODULE: m2-jvm()()(m1-common)
1817
// FILE: jvm.kt
1918

20-
@OptIn(ExperimentalMultiplatform::class)
21-
@AllowDifferentMembersInActual
22-
actual open class Base<T> {
19+
actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Base<!><T> {
2320
actual fun existingMethodInBase(param: T) {}
24-
fun injected() {}
21+
fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING!>injected<!>() {}
2522
}
2623

2724
actual open class Foo : Transitive() {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// WITH_STDLIB
2+
// MODULE: m1-common
3+
// FILE: common.kt
4+
5+
expect open class Base() {
6+
fun existingMethodInBase()
7+
}
8+
9+
expect open class Foo : Base {
10+
fun existingMethod()
11+
val existingParam: Int
12+
}
13+
14+
// MODULE: m2-jvm()()(m1-common)
15+
// FILE: jvm.kt
16+
17+
actual typealias Base = BaseImpl
18+
19+
open class BaseImpl {
20+
fun existingMethodInBase() {}
21+
fun injected() {}
22+
}
23+
24+
actual open class Foo : Base() {
25+
actual fun existingMethod() {}
26+
actual val existingParam: Int = 904
27+
}

compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_supertypeIsActualTypealias_injectMethod.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// FIR_IDENTICAL
21
// WITH_STDLIB
32
// MODULE: m1-common
43
// FILE: common.kt
@@ -15,9 +14,7 @@ expect open class Foo : Base {
1514
// MODULE: m2-jvm()()(m1-common)
1615
// FILE: jvm.kt
1716

18-
@OptIn(ExperimentalMultiplatform::class)
19-
@AllowDifferentMembersInActual
20-
actual typealias Base = BaseImpl
17+
actual typealias <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>Base<!> = BaseImpl
2118

2219
open class BaseImpl {
2320
fun existingMethodInBase() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// WITH_STDLIB
2+
// MODULE: m1-common
3+
// FILE: common.kt
4+
5+
expect open class Base<T>() {
6+
fun existingMethodInBase(param: T)
7+
}
8+
9+
open class Transitive : Base<String>()
10+
11+
expect open class Foo : Transitive {
12+
fun existingMethod()
13+
val existingParam: Int
14+
}
15+
16+
// MODULE: m2-jvm()()(m1-common)
17+
// FILE: jvm.kt
18+
19+
actual typealias Base<T> = BaseImpl<T>
20+
21+
open class BaseImpl<T> {
22+
fun existingMethodInBase(param: T) {}
23+
fun injected() {}
24+
}
25+
26+
actual open class Foo : Transitive() {
27+
actual fun existingMethod() {}
28+
actual val existingParam: Int = 904
29+
}

compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/supertypeIsExpectActual_supertypeIsActualTypealias_injectMethod_transitiveSubstitutionFakeOverride.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// FIR_IDENTICAL
21
// WITH_STDLIB
32
// MODULE: m1-common
43
// FILE: common.kt
@@ -17,9 +16,7 @@ expect open class Foo : Transitive {
1716
// MODULE: m2-jvm()()(m1-common)
1817
// FILE: jvm.kt
1918

20-
@OptIn(ExperimentalMultiplatform::class)
21-
@AllowDifferentMembersInActual
22-
actual typealias Base<T> = BaseImpl<T>
19+
actual typealias <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>Base<!><T> = BaseImpl<T>
2320

2421
open class BaseImpl<T> {
2522
fun existingMethodInBase(param: T) {}

compiler/testData/diagnostics/tests/multiplatform/implicitActualFakeOverride_AbstractMap.fir.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,4 @@
1212

1313
import java.util.AbstractMap
1414

15-
@OptIn(kotlin.ExperimentalMultiplatform::class)
16-
@kotlin.AllowDifferentMembersInActual
1715
public actual abstract class AbstractMutableMap<K, V>() : MutableMap<K, V>, AbstractMap<K, V>()

0 commit comments

Comments
 (0)