[FIR] Fix disappeared ACTUAL_MISSING

^KT-59887 Fixed

Review: https://jetbrains.team/p/kt/reviews/13244
This commit is contained in:
Nikita Bobko
2023-11-20 17:40:06 +01:00
committed by Space Team
parent e44e84d1b0
commit 8c0cf7d0bc
80 changed files with 244 additions and 217 deletions
@@ -32,7 +32,7 @@ expect class ImplicitlyActualizedByJvmDeclarationOnExpectOnly
package kotlin
@OptIn(ExperimentalMultiplatform::class)
actual annotation class <!ACTUAL_WITHOUT_EXPECT, ACTUAL_WITHOUT_EXPECT!>OptionalExpectationOnExpectOnly<!>
actual annotation class <!ACTUAL_WITHOUT_EXPECT!>OptionalExpectationOnExpectOnly<!>
actual fun <!ACTUAL_WITHOUT_EXPECT!>skippedAnnotationsOnExpectOnly<!>() {}
@@ -10,6 +10,6 @@ open class Base {
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> : Base() {
override fun <R> foo(t: R) {}
actual open class Foo : Base() {
override fun <R> <!ACTUAL_WITHOUT_EXPECT!>foo<!>(t: R) {}
}
@@ -10,6 +10,6 @@ expect open class Foo : Base
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> : Base() {
override fun <R> foo(t: R) {}
actual open class Foo : Base() {
override fun <R> <!ACTUAL_WITHOUT_EXPECT!>foo<!>(t: R) {}
}
@@ -13,8 +13,8 @@ open class Base {
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> : Base() {
override lateinit var red1: String
override var red2: String = ""
actual open class Foo : Base() {
override lateinit var <!ACTUAL_WITHOUT_EXPECT!>red1<!>: String
override var <!ACTUAL_WITHOUT_EXPECT!>red2<!>: String = ""
override lateinit var green: String
}
@@ -13,8 +13,8 @@ expect open class Foo : Base {
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> : Base() {
override lateinit var red1: String
override var red2: String = ""
actual open class Foo : Base() {
override lateinit var <!ACTUAL_WITHOUT_EXPECT!>red1<!>: String
override var <!ACTUAL_WITHOUT_EXPECT!>red2<!>: String = ""
override lateinit var green: String
}
@@ -10,6 +10,6 @@ interface Base {
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> : Base {
final override fun foo() {}
actual open class Foo : Base {
final override fun <!ACTUAL_WITHOUT_EXPECT!>foo<!>() {}
}
@@ -10,6 +10,6 @@ expect open <!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>class Foo<!> : Base
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> : Base {
final override fun foo() {}
actual open class Foo : Base {
final override fun <!ACTUAL_WITHOUT_EXPECT!>foo<!>() {}
}
@@ -12,6 +12,6 @@ interface Base {
// Mismatched scope must be reported here. But it's false negative checker in K1.
// For some reason, K1 says that modality of `exect_Foo.foo` is `abstract`.
// https://youtrack.jetbrains.com/issue/KT-59739
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> : Base {
override fun foo() {}
actual open class Foo : Base {
override fun <!ACTUAL_WITHOUT_EXPECT!>foo<!>() {}
}
@@ -12,6 +12,6 @@ expect open <!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>class Foo<!>() : Base
// Mismatched scope must be reported here. But it's false negative checker in K1.
// For some reason, K1 says that modality of `exect_Foo.foo` is `abstract`.
// https://youtrack.jetbrains.com/issue/KT-59739
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> : Base {
override fun foo() {}
actual open class Foo : Base {
override fun <!ACTUAL_WITHOUT_EXPECT!>foo<!>() {}
}
@@ -9,6 +9,6 @@ interface Base {
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual abstract class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> : Base {
abstract override fun foo()
actual abstract class Foo : Base {
abstract override fun <!ACTUAL_WITHOUT_EXPECT!>foo<!>()
}
@@ -9,6 +9,6 @@ expect abstract class Foo() : Base
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual abstract class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> : Base {
abstract override fun foo()
actual abstract class Foo : Base {
abstract override fun <!ACTUAL_WITHOUT_EXPECT!>foo<!>()
}
@@ -10,6 +10,6 @@ open class Base {
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> : Base() {
final override fun foo() {}
actual open class Foo : Base() {
final override fun <!ACTUAL_WITHOUT_EXPECT!>foo<!>() {}
}
@@ -10,6 +10,6 @@ expect open class Foo : Base
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> : Base() {
final override fun foo() {}
actual open class Foo : Base() {
final override fun <!ACTUAL_WITHOUT_EXPECT!>foo<!>() {}
}
@@ -10,6 +10,6 @@ open class Base<T> {
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> : Base<String>() {
final override fun foo(t: String) {}
actual open class Foo : Base<String>() {
final override fun <!ACTUAL_WITHOUT_EXPECT!>foo<!>(t: String) {}
}
@@ -10,6 +10,6 @@ expect open class Foo : Base<String>
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> : Base<String>() {
final override fun foo(t: String) {}
actual open class Foo : Base<String>() {
final override fun <!ACTUAL_WITHOUT_EXPECT!>foo<!>(t: String) {}
}
@@ -6,6 +6,6 @@
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> {
final override fun toString() = "Foo"
actual open class Foo {
final override fun <!ACTUAL_WITHOUT_EXPECT!>toString<!>() = "Foo"
}
@@ -6,6 +6,6 @@ expect open class Foo
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> {
final override fun toString() = "Foo"
actual open class Foo {
final override fun <!ACTUAL_WITHOUT_EXPECT!>toString<!>() = "Foo"
}
@@ -14,8 +14,8 @@ expect open class Foo3 {
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo1<!> : Base() {
override fun foo(paramNameChanged: Int) {}
actual open class Foo1 : Base() {
override fun <!ACTUAL_WITHOUT_EXPECT!>foo<!>(paramNameChanged: Int) {}
}
actual typealias Foo2 = Foo2Java
@@ -14,8 +14,8 @@ expect open class Foo3 {
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo1<!> : Base() {
override fun foo(paramNameChanged: Int) {}
actual open class Foo1 : Base() {
override fun <!ACTUAL_WITHOUT_EXPECT!>foo<!>(paramNameChanged: Int) {}
}
actual typealias Foo2 = Foo2Java
@@ -11,6 +11,6 @@ open class Base {
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> : Base() {
override fun foo(bar: IntArray) {}
actual open class Foo : Base() {
override fun <!ACTUAL_WITHOUT_EXPECT!>foo<!>(bar: IntArray) {}
}
@@ -11,6 +11,6 @@ expect open class Foo : Base {
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> : Base() {
override fun foo(bar: IntArray) {}
actual open class Foo : Base() {
override fun <!ACTUAL_WITHOUT_EXPECT!>foo<!>(bar: IntArray) {}
}
@@ -10,6 +10,6 @@ open class Base {
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> : Base() {
public override fun foo() {}
actual open class Foo : Base() {
public override fun <!ACTUAL_WITHOUT_EXPECT!>foo<!>() {}
}
@@ -10,6 +10,6 @@ expect open class Foo : Base
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> : Base() {
public override fun foo() {}
actual open class Foo : Base() {
public override fun <!ACTUAL_WITHOUT_EXPECT!>foo<!>() {}
}
@@ -12,6 +12,6 @@ open class Base {
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> : Base() {
override fun foo(): String = ""
actual open class Foo : Base() {
override fun <!ACTUAL_WITHOUT_EXPECT!>foo<!>(): String = ""
}
@@ -12,6 +12,6 @@ expect open class Foo : Base {
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> : Base() {
override fun foo(): String = ""
actual open class Foo : Base() {
override fun <!ACTUAL_WITHOUT_EXPECT!>foo<!>(): String = ""
}
@@ -13,6 +13,6 @@ open class Base {
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!><T : I> : Base() {
override fun foo(): T = null!!
actual open class Foo<T : I> : Base() {
override fun <!ACTUAL_WITHOUT_EXPECT!>foo<!>(): T = null!!
}
@@ -13,6 +13,6 @@ expect open class Foo<T : I> : Base {
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!><T : I> : Base() {
override fun foo(): T = null!!
actual open class Foo<T : I> : Base() {
override fun <!ACTUAL_WITHOUT_EXPECT!>foo<!>(): T = null!!
}
@@ -11,6 +11,6 @@ open class Base<R> {
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!><E, F : E> : Base<E>() {
override fun foo(): F = null!!
actual open class Foo<E, F : E> : Base<E>() {
override fun <!ACTUAL_WITHOUT_EXPECT!>foo<!>(): F = null!!
}
@@ -11,6 +11,6 @@ expect open class Foo<R, T : R> : Base<R> {
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!><E, F : E> : Base<E>() {
override fun foo(): F = null!!
actual open class Foo<E, F : E> : Base<E>() {
override fun <!ACTUAL_WITHOUT_EXPECT!>foo<!>(): F = null!!
}
@@ -11,6 +11,6 @@ open class Base {
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> : Base() {
override val foo: String = ""
actual open class Foo : Base() {
override val <!ACTUAL_WITHOUT_EXPECT!>foo<!>: String = ""
}
@@ -11,6 +11,6 @@ expect open class Foo : Base
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> : Base() {
override val foo: String = ""
actual open class Foo : Base() {
override val <!ACTUAL_WITHOUT_EXPECT!>foo<!>: String = ""
}
@@ -14,11 +14,11 @@ expect open class Base {
actual typealias Base = BaseJava
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> : Base() {
actual open class Foo : Base() {
// K1 doesn't report a diagnostic here because when it compares scopes it sees flexible type
// K2 will likely report a diagnostic here
// I don't think we can fix this 'K1 green -> K2 red'. It must be a rare case anyway.
override fun foo(): List<String> {
override fun <!ACTUAL_WITHOUT_EXPECT!>foo<!>(): List<String> {
return super.foo()
}
}
@@ -14,11 +14,11 @@ expect open class Foo : Base {
actual typealias Base = BaseJava
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> : Base() {
actual open class Foo : Base() {
// K1 doesn't report a diagnostic here because when it compares scopes it sees flexible type
// K2 will likely report a diagnostic here
// I don't think we can fix this 'K1 green -> K2 red'. It must be a rare case anyway.
override fun foo(): List<String> {
override fun <!ACTUAL_WITHOUT_EXPECT!>foo<!>(): List<String> {
return super.foo()
}
}
@@ -15,5 +15,5 @@ actual open class Foo {
// Expected: NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION_WARNING.
// But it doesn't work because context receivers are not yet supported in expect actual matcher KT-61447
context(Int)
fun foo() {}
fun <!ACTUAL_MISSING!>foo<!>() {}
}
@@ -10,6 +10,6 @@ open class Base {
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> : Base() {
override var foo: Int = 1
actual open class Foo : Base() {
override var <!ACTUAL_WITHOUT_EXPECT!>foo<!>: Int = 1
}
@@ -10,6 +10,6 @@ expect open class Foo : Base
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> : Base() {
override var foo: Int = 1
actual open class Foo : Base() {
override var <!ACTUAL_WITHOUT_EXPECT!>foo<!>: Int = 1
}
@@ -16,14 +16,14 @@ open class Base() {
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> : Base() {
actual open class Foo : Base() {
actual fun existingMethod() {}
actual val existingParam: Int = 904
fun injectedMethod() {}
val injectedProperty: Int = 42
override fun overrideReturnType(): String = ""
final override fun overrideModality1(): Any = ""
final override fun overrideModality2(): Any = ""
public override fun overrideVisibility(): Any = ""
override fun <!ACTUAL_WITHOUT_EXPECT!>overrideReturnType<!>(): String = ""
final override fun <!ACTUAL_WITHOUT_EXPECT!>overrideModality1<!>(): Any = ""
final override fun <!ACTUAL_WITHOUT_EXPECT!>overrideModality2<!>(): Any = ""
public override fun <!ACTUAL_WITHOUT_EXPECT!>overrideVisibility<!>(): Any = ""
}
@@ -16,14 +16,14 @@ expect open class Foo : Base {
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> : Base() {
actual open class Foo : Base() {
actual fun existingMethod() {}
actual val existingParam: Int = 904
fun injectedMethod() {}
val injectedProperty: Int = 42
override fun overrideReturnType(): String = ""
final override fun overrideModality1(): Any = ""
final override fun overrideModality2(): Any = ""
public override fun overrideVisibility(): Any = ""
override fun <!ACTUAL_WITHOUT_EXPECT!>overrideReturnType<!>(): String = ""
final override fun <!ACTUAL_WITHOUT_EXPECT!>overrideModality1<!>(): Any = ""
final override fun <!ACTUAL_WITHOUT_EXPECT!>overrideModality2<!>(): Any = ""
public override fun <!ACTUAL_WITHOUT_EXPECT!>overrideVisibility<!>(): Any = ""
}
@@ -9,7 +9,11 @@ fun test() {}
// MODULE: m1-jvm()()(m1-common)
// FILE: jvm.kt
actual annotation class A(val x: Array<String>)
// return types are different in expect and actual (Array<out String> in expect vs Array<String> in actual).
// In K1, different return types are mistakenly considered as expect-actual mismatch ("strong incompatibility" in old terminology)
// In K2, different return types are considered as expect-actual incompatibility ("weak incompatibility" in old terminology)
// ACTUAL_MISSING is not reported only when there is a mismatch => K2 is correct
actual annotation class A(val <!ACTUAL_MISSING!>x<!>: Array<String>)
@A(<!ARGUMENT_TYPE_MISMATCH!>"abc"<!>, <!TOO_MANY_ARGUMENTS!>"foo"<!>, <!TOO_MANY_ARGUMENTS!>"bar"<!>)
fun test2() {}
@@ -9,6 +9,10 @@ fun test() {}
// MODULE: m1-jvm()()(m1-common)
// FILE: jvm.kt
// return types are different in expect and actual (Array<out String> in expect vs Array<String> in actual).
// In K1, different return types are mistakenly considered as expect-actual mismatch ("strong incompatibility" in old terminology)
// In K2, different return types are considered as expect-actual incompatibility ("weak incompatibility" in old terminology)
// ACTUAL_MISSING is not reported only when there is a mismatch => K2 is correct
actual annotation class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>A<!>(val x: Array<String>)
@A(<!TYPE_MISMATCH!>"abc"<!>, <!TOO_MANY_ARGUMENTS!>"foo"<!>, <!TOO_MANY_ARGUMENTS!>"bar"<!>)
@@ -9,7 +9,11 @@ fun test() {}
// MODULE: m1-jvm()()(m1-common)
// FILE: jvm.kt
actual annotation class A(val x: Array<String>)
// return types are different in expect and actual (Array<out String> in expect vs Array<String> in actual).
// In K1, different return types are mistakenly considered as expect-actual mismatch ("strong incompatibility" in old terminology)
// In K2, different return types are considered as expect-actual incompatibility ("weak incompatibility" in old terminology)
// ACTUAL_MISSING is not reported only when there is a mismatch => K2 is correct
actual annotation class A<!ACTUAL_WITHOUT_EXPECT!>(val <!ACTUAL_MISSING!>x<!>: Array<String>)<!>
@A(<!ARGUMENT_TYPE_MISMATCH!>"abc"<!>, <!TOO_MANY_ARGUMENTS!>"foo"<!>, <!TOO_MANY_ARGUMENTS!>"bar"<!>)
fun test2() {}
@@ -9,6 +9,10 @@ fun test() {}
// MODULE: m1-jvm()()(m1-common)
// FILE: jvm.kt
// return types are different in expect and actual (Array<out String> in expect vs Array<String> in actual).
// In K1, different return types are mistakenly considered as expect-actual mismatch ("strong incompatibility" in old terminology)
// In K2, different return types are considered as expect-actual incompatibility ("weak incompatibility" in old terminology)
// ACTUAL_MISSING is not reported only when there is a mismatch => K2 is correct
actual annotation class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>A<!>(val x: Array<String>)
@A(<!TYPE_MISMATCH!>"abc"<!>, <!TOO_MANY_ARGUMENTS!>"foo"<!>, <!TOO_MANY_ARGUMENTS!>"bar"<!>)
@@ -9,7 +9,11 @@ fun test() {}
// MODULE: m1-jvm()()(m1-common)
// FILE: jvm.kt
actual annotation class A(val x: Array<String>)
// return types are different in expect and actual (Array<out String> in expect vs Array<String> in actual).
// In K1, different return types are mistakenly considered as expect-actual mismatch ("strong incompatibility" in old terminology)
// In K2, different return types are considered as expect-actual incompatibility ("weak incompatibility" in old terminology)
// ACTUAL_MISSING is not reported only when there is a mismatch => K2 is correct
actual annotation class A<!ACTUAL_WITHOUT_EXPECT!>(val <!ACTUAL_MISSING!>x<!>: Array<String>)<!>
@A(<!ARGUMENT_TYPE_MISMATCH!>"abc"<!>, <!TOO_MANY_ARGUMENTS!>"foo"<!>, <!TOO_MANY_ARGUMENTS!>"bar"<!>)
fun test2() {}
@@ -28,10 +28,10 @@ expect class M01 {
// FILE: jvm.kt
actual object E01
actual object <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>E02<!>
actual object <!ACTUAL_WITHOUT_EXPECT!>E02<!>
actual object <!ACTUAL_WITHOUT_EXPECT!>E03<!>
actual object <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>E04<!>
actual object <!ACTUAL_WITHOUT_EXPECT!>E04<!>
actual object <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>E05<!>
actual object <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>E06<!>
@@ -28,10 +28,10 @@ expect annotation class ANNO01
// FILE: jvm.kt
actual object E01
actual object <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>E02<!>
actual object <!ACTUAL_WITHOUT_EXPECT!>E02<!>
actual object <!ACTUAL_WITHOUT_EXPECT!>E03<!>
actual object <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>E04<!>
actual object <!ACTUAL_WITHOUT_EXPECT!>E04<!>
actual object <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>E05<!>
actual object <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>E06<!>
@@ -37,7 +37,7 @@ actual class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Bar1<!>(val s: String)
actual class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Bar2<!>(val p: String = "value", i: Int)
actual typealias <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Bar3<!> = JavaBar
actual class Bar4(val s: String) {
constructor() : this("")
<!ACTUAL_MISSING!>constructor() : this("")<!>
}
actual class Bar5 {
@@ -45,7 +45,7 @@ actual class Bar5 {
constructor(s: String)
}
class Bar6 {
class <!ACTUAL_MISSING!>Bar6<!> {
actual constructor()
}
@@ -37,7 +37,7 @@ actual class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Bar1<!>(val s: String)
actual class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Bar2<!>(val p: String = "value", i: Int)
actual typealias <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Bar3<!> = JavaBar
actual class Bar4(val s: String) {
constructor() : this("")
<!ACTUAL_MISSING!>constructor() : this("")<!>
}
actual class Bar5 {
@@ -45,8 +45,8 @@ actual class Bar5 {
constructor(s: String)
}
class Bar6 {
<!ACTUAL_WITHOUT_EXPECT!>actual constructor()<!>
class <!ACTUAL_MISSING!>Bar6<!> {
actual constructor()
}
actual class Bar7 actual constructor(s: String) {
@@ -1,13 +0,0 @@
// MODULE: m1-common
// FILE: common.kt
expect class A {
fun foo()
}
// MODULE: m1-jvm()()(m1-common)
// FILE: jvm.kt
class A {
actual fun <!ACTUAL_WITHOUT_EXPECT!>foo<!>() {}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// MODULE: m1-common
// FILE: common.kt
@@ -2,6 +2,6 @@
<!EXPECT_ACTUAL_INCOMPATIBILITY{JVM}, EXPECT_ACTUAL_INCOMPATIBILITY{JVM}!>expect interface Base<!>
// MODULE: m1-jvm()()(m1-common)
actual interface <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Base<!> {
override fun equals(other: Any?): Boolean
actual interface Base {
override fun <!ACTUAL_WITHOUT_EXPECT!>equals<!>(other: Any?): Boolean
}
@@ -2,6 +2,6 @@
expect interface Base
// MODULE: m1-jvm()()(m1-common)
actual interface <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Base<!> {
override fun equals(other: Any?): Boolean
actual interface Base {
override fun <!ACTUAL_WITHOUT_EXPECT!>equals<!>(other: Any?): Boolean
}
@@ -15,13 +15,13 @@ expect open class Foo3
// FILE: jvm.kt
interface Foo1
interface <!ACTUAL_MISSING!>Foo1<!>
actual interface <!ACTUAL_WITHOUT_EXPECT!>Foo2<!>
actual var <!ACTUAL_WITHOUT_EXPECT!>s<!>: String = "value"
fun foo2(): Int = 0
fun <!ACTUAL_MISSING!>foo2<!>(): Int = 0
actual class <!ACTUAL_WITHOUT_EXPECT, PACKAGE_OR_CLASSIFIER_REDECLARATION!>Foo3<!>
class <!PACKAGE_OR_CLASSIFIER_REDECLARATION!>Foo3<!>
class <!ACTUAL_MISSING, PACKAGE_OR_CLASSIFIER_REDECLARATION!>Foo3<!>
@@ -31,5 +31,5 @@ actual class DerivedExplicit : Base() {
}
actual class DerivedExplicitCheck : Base() {
override fun foo() {}
override fun <!ACTUAL_MISSING!>foo<!>() {}
}
@@ -1,34 +0,0 @@
// MODULE: m1-common
// FILE: common.kt
expect class Foo1 {
val x: String
}
expect class Foo2 {
val x: String
}
expect class Foo3 {
val x: String
}
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
open class Open {
open val x = "42"
}
actual open class Foo1 : Open() {
override val x = super.x
}
actual open class Foo2 : Open()
open class WithFinal {
val x = "42"
}
actual open class Foo3 : WithFinal()
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// MODULE: m1-common
// FILE: common.kt
@@ -41,5 +41,5 @@ actual class C {
actual class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>D<!>
actual class E {
class N
class <!ACTUAL_MISSING!>N<!>
}
@@ -41,5 +41,5 @@ actual class C {
actual class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>D<!>
actual class E {
class N
class <!ACTUAL_MISSING!>N<!>
}
@@ -9,7 +9,7 @@
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> {
fun bar(): String = "bar"
fun bas(g: Int) {}
actual class Foo {
fun <!ACTUAL_MISSING!>bar<!>(): String = "bar"
fun <!ACTUAL_MISSING!>bas<!>(g: Int) {}
}
@@ -9,7 +9,7 @@ expect class Foo {
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> {
fun bar(): String = "bar"
fun bas(g: Int) {}
actual class Foo {
fun <!ACTUAL_MISSING!>bar<!>(): String = "bar"
fun <!ACTUAL_MISSING!>bas<!>(g: Int) {}
}
@@ -16,8 +16,8 @@ expect class A private constructor() {
// FILE: jvm.kt
actual class A actual private constructor() {
private fun foo() {}
private val bar: String = ""
private fun <!ACTUAL_MISSING!>foo<!>() {}
private val <!ACTUAL_MISSING!>bar<!>: String = ""
actual private fun Int.memExt(): Any = 0
actual private class Nested
@@ -20,7 +20,7 @@ expect inline class NonInlineActual(val x: Int)
actual inline class Foo1(val x: Int) {
actual fun bar(): String = "Hello"
}
actual inline class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS, NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo2<!>(val x: String)
actual inline class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo2<!>(val <!ACTUAL_WITHOUT_EXPECT!>x<!>: String)
actual <!ABSENCE_OF_PRIMARY_CONSTRUCTOR_FOR_VALUE_CLASS!>inline<!> class Foo3
actual inline class <!ACTUAL_WITHOUT_EXPECT!>NonInlineExpect<!>(val x: Int)
@@ -15,6 +15,6 @@ public class Foo {
// FILE: jvm.kt
class <!PACKAGE_OR_CLASSIFIER_REDECLARATION!>Foo<!><T>(t: T) {
fun foo() {}
class <!ACTUAL_MISSING, PACKAGE_OR_CLASSIFIER_REDECLARATION!>Foo<!><T>(t: T) {
fun <!ACTUAL_MISSING!>foo<!>() {}
}
@@ -15,6 +15,6 @@ public class Foo {
// FILE: jvm.kt
class <!PACKAGE_OR_CLASSIFIER_REDECLARATION!>Foo<!><T>(t: T) {
fun foo() {}
class <!ACTUAL_MISSING, PACKAGE_OR_CLASSIFIER_REDECLARATION!>Foo<!><T>(t: T) {
fun <!ACTUAL_MISSING!>foo<!>() {}
}
@@ -7,5 +7,5 @@ interface A
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
fun <T : A> foo(t: T): T = TODO()
fun <T : A> <!ACTUAL_MISSING!>foo<!>(t: T): T = TODO()
fun <T> foo(t: T): String = TODO()
@@ -7,5 +7,5 @@ expect fun <T : A> foo(t: T): String
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
fun <T : A> foo(t: T): T = TODO()
fun <T : A> <!ACTUAL_MISSING!>foo<!>(t: T): T = TODO()
fun <T> foo(t: T): String = TODO()
@@ -18,8 +18,8 @@ internal expect open class Other {
// MODULE: platform-jvm()()(common)
public actual open class Some { // should be allowed
public class ProtectedNested // should be allowed
public class InternalNested // should be allowed
public class <!ACTUAL_MISSING!>ProtectedNested<!> // should be allowed
public class <!ACTUAL_MISSING!>InternalNested<!> // should be allowed
public actual fun publicFun() {} // should be allowed
public actual fun internalFun() {} // should be allowed