[FIR] Make expect class members also expect

This commit is contained in:
Mikhail Glukhikh
2020-06-24 15:25:52 +03:00
parent 2fefa682b7
commit c1609ed490
20 changed files with 124 additions and 85 deletions
@@ -1,10 +1,10 @@
FILE: common.kt
public open expect class A<T> : R|kotlin/Any| {
public constructor<T>(): R|A<T>| {
public expect constructor<T>(): R|A<T>| {
super<R|kotlin/Any|>()
}
public open fun foo(arg: R|T|): R|kotlin/Unit|
public open expect fun foo(arg: R|T|): R|kotlin/Unit|
}
public open class B : R|A<kotlin/String>| {
@@ -1,10 +1,10 @@
FILE: common.kt
public final expect class MyList : R|kotlin/Any| {
public constructor(): R|MyList| {
public expect constructor(): R|MyList| {
super<R|kotlin/Any|>()
}
public final fun get(i: R|kotlin/Int|): R|kotlin/Int|
public final expect fun get(i: R|kotlin/Int|): R|kotlin/Int|
}
public open class Wrapper : R|kotlin/Any| {
@@ -4,6 +4,8 @@
expect open class A() {
fun foo()
val x: Int
}
open class B : A()
@@ -15,12 +17,15 @@ actual open class A {
actual fun foo() {}
fun bar() {}
actual val x = 42
}
class C : B() {
fun test() {
foo()
bar()
x + x
}
}
@@ -28,5 +33,6 @@ class D : A() {
fun test() {
foo()
bar()
x + x
}
}
@@ -1,10 +1,13 @@
FILE: common.kt
public open expect class A : R|kotlin/Any| {
public constructor(): R|A| {
public expect constructor(): R|A| {
super<R|kotlin/Any|>()
}
public final fun foo(): R|kotlin/Unit|
public final expect fun foo(): R|kotlin/Unit|
public final expect val x: R|kotlin/Int|
public get(): R|kotlin/Int|
}
public open class B : R|A| {
@@ -25,6 +28,9 @@ FILE: jvm.kt
public final fun bar(): R|kotlin/Unit| {
}
public final actual val x: R|kotlin/Int| = Int(42)
public get(): R|kotlin/Int|
}
public final class C : R|B| {
public constructor(): R|C| {
@@ -34,6 +40,7 @@ FILE: jvm.kt
public final fun test(): R|kotlin/Unit| {
this@R|/C|.R|/A.foo|()
this@R|/C|.R|/A.bar|()
this@R|/C|.R|/A.x|.R|kotlin/Int.plus|(this@R|/C|.R|/A.x|)
}
}
@@ -45,6 +52,7 @@ FILE: jvm.kt
public final fun test(): R|kotlin/Unit| {
this@R|/D|.R|/A.foo|()
this@R|/D|.R|/A.bar|()
this@R|/D|.R|/A.x|.R|kotlin/Int.plus|(this@R|/D|.R|/A.x|)
}
}
@@ -1,10 +1,10 @@
FILE: common.kt
public open expect class A : R|kotlin/Any| {
public constructor(): R|A| {
public expect constructor(): R|A| {
super<R|kotlin/Any|>()
}
public final fun foo(): R|kotlin/Unit|
public final expect fun foo(): R|kotlin/Unit|
}
public open class B : R|A| {