Make FIR multi-module tests from IDE regular FIR compiler resolve tests
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
// MODULE: m1
|
||||
// FILE: base.kt
|
||||
|
||||
package hello
|
||||
|
||||
class Hello(val msg: String)
|
||||
|
||||
class Test(val set: java.util.Set<*>)
|
||||
|
||||
// MODULE: m2(m1)
|
||||
// FILE: user.kt
|
||||
|
||||
package test
|
||||
|
||||
import hello.Hello
|
||||
|
||||
fun foo(hello: Hello): String = hello.msg
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
FILE: base.kt
|
||||
public final class Hello : R|kotlin/Any| {
|
||||
public constructor(msg: R|kotlin/String|): R|hello/Hello| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final val msg: R|kotlin/String| = R|<local>/msg|
|
||||
public get(): R|kotlin/String|
|
||||
|
||||
}
|
||||
public final class Test : R|kotlin/Any| {
|
||||
public constructor(set: R|java/util/Set<*>|): R|hello/Test| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final val set: R|java/util/Set<*>| = R|<local>/set|
|
||||
public get(): R|java/util/Set<*>|
|
||||
|
||||
}
|
||||
FILE: user.kt
|
||||
public final fun foo(hello: R|hello/Hello|): R|kotlin/String| {
|
||||
^foo R|<local>/hello|.R|hello/Hello.msg|
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
// !LANGUAGE: +MultiPlatformProjects
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
|
||||
expect open class A<T>() {
|
||||
open fun foo(arg: T)
|
||||
}
|
||||
open class B : A<String>() {
|
||||
// Fake: override fun foo(arg: String) = super.foo(arg)
|
||||
// Fake (JVM only): override fun bar(arg: String): String = super.bar(arg)
|
||||
}
|
||||
open class C : B() {
|
||||
open fun bar(arg: String): String = arg
|
||||
open fun baz(arg: CharSequence): String = arg.toString()
|
||||
}
|
||||
|
||||
// MODULE: m1-jvm(m1-common)
|
||||
// FILE: jvm.kt
|
||||
|
||||
actual open class A<T> {
|
||||
actual open fun foo(arg: T) {}
|
||||
open fun bar(arg: T): T = arg
|
||||
open fun baz(arg: T): T = arg
|
||||
}
|
||||
class D : C() {
|
||||
fun test() {
|
||||
foo("")
|
||||
bar("") // should be resolved to just C.bar
|
||||
baz("")
|
||||
}
|
||||
}
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
FILE: common.kt
|
||||
public open expect class A<T> : R|kotlin/Any| {
|
||||
public constructor<T>(): R|A<T>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public open fun foo(arg: R|T|): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
public open class B : R|A<kotlin/String>| {
|
||||
public constructor(): R|B| {
|
||||
super<R|A<kotlin/String>|>()
|
||||
}
|
||||
|
||||
}
|
||||
public open class C : R|B| {
|
||||
public constructor(): R|C| {
|
||||
super<R|B|>()
|
||||
}
|
||||
|
||||
public open fun bar(arg: R|kotlin/String|): R|kotlin/String| {
|
||||
^bar R|<local>/arg|
|
||||
}
|
||||
|
||||
public open fun baz(arg: R|kotlin/CharSequence|): R|kotlin/String| {
|
||||
^baz R|<local>/arg|.R|kotlin/Any.toString|()
|
||||
}
|
||||
|
||||
}
|
||||
FILE: jvm.kt
|
||||
public open actual class A<T> : R|kotlin/Any| {
|
||||
public constructor<T>(): R|A<T>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public open actual fun foo(arg: R|T|): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
public open fun bar(arg: R|T|): R|T| {
|
||||
^bar R|<local>/arg|
|
||||
}
|
||||
|
||||
public open fun baz(arg: R|T|): R|T| {
|
||||
^baz R|<local>/arg|
|
||||
}
|
||||
|
||||
}
|
||||
public final class D : R|C| {
|
||||
public constructor(): R|D| {
|
||||
super<R|C|>()
|
||||
}
|
||||
|
||||
public final fun test(): R|kotlin/Unit| {
|
||||
this@R|/D|.R|FakeOverride</B.foo: R|kotlin/Unit|>|(String())
|
||||
this@R|/D|.R|/C.bar|(String())
|
||||
this@R|/D|.R|FakeOverride</B.baz: R|kotlin/String|>|(String())
|
||||
}
|
||||
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
// !LANGUAGE: +MultiPlatformProjects
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
|
||||
expect class MyList {
|
||||
fun get(i: Int): Int
|
||||
}
|
||||
|
||||
open class Wrapper(val list: MyList)
|
||||
|
||||
// MODULE: m1-jvm(m1-common)
|
||||
// FILE: jvm.kt
|
||||
|
||||
actual class MyList {
|
||||
actual fun get(i: Int): Int = i
|
||||
|
||||
fun set(i: Int, v: Int) {}
|
||||
}
|
||||
|
||||
class DerivedList : MyList() {
|
||||
fun useMember() {
|
||||
get(1)
|
||||
set(2, 3)
|
||||
}
|
||||
}
|
||||
|
||||
fun useList(list: MyList) {
|
||||
// We should deal with receiver to resolve this
|
||||
list.get(1)
|
||||
list.set(2, 3)
|
||||
}
|
||||
|
||||
class DerivedWrapper : Wrapper(MyList()) {
|
||||
fun use() {
|
||||
// We should deal with receiver to resolve this
|
||||
list.get(1)
|
||||
list.set(2, 3)
|
||||
}
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
FILE: common.kt
|
||||
public final expect class MyList : R|kotlin/Any| {
|
||||
public constructor(): R|MyList| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final fun get(i: R|kotlin/Int|): R|kotlin/Int|
|
||||
|
||||
}
|
||||
public open class Wrapper : R|kotlin/Any| {
|
||||
public constructor(list: R|MyList|): R|Wrapper| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final val list: R|MyList| = R|<local>/list|
|
||||
public get(): R|MyList|
|
||||
|
||||
}
|
||||
FILE: jvm.kt
|
||||
public final actual class MyList : R|kotlin/Any| {
|
||||
public constructor(): R|MyList| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final actual fun get(i: R|kotlin/Int|): R|kotlin/Int| {
|
||||
^get R|<local>/i|
|
||||
}
|
||||
|
||||
public final fun set(i: R|kotlin/Int|, v: R|kotlin/Int|): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
public final class DerivedList : R|MyList| {
|
||||
public constructor(): R|DerivedList| {
|
||||
super<R|MyList|>()
|
||||
}
|
||||
|
||||
public final fun useMember(): R|kotlin/Unit| {
|
||||
this@R|/DerivedList|.R|/MyList.get|(Int(1))
|
||||
this@R|/DerivedList|.R|/MyList.set|(Int(2), Int(3))
|
||||
}
|
||||
|
||||
}
|
||||
public final fun useList(list: R|MyList|): R|kotlin/Unit| {
|
||||
R|<local>/list|.R|/MyList.get|(Int(1))
|
||||
R|<local>/list|.R|/MyList.set|(Int(2), Int(3))
|
||||
}
|
||||
public final class DerivedWrapper : R|Wrapper| {
|
||||
public constructor(): R|DerivedWrapper| {
|
||||
super<R|Wrapper|>(R|/MyList.MyList|())
|
||||
}
|
||||
|
||||
public final fun use(): R|kotlin/Unit| {
|
||||
this@R|/DerivedWrapper|.R|/Wrapper.list|.R|/MyList.get|(Int(1))
|
||||
this@R|/DerivedWrapper|.R|/Wrapper.list|.R|/MyList.set|(Int(2), Int(3))
|
||||
}
|
||||
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
// !LANGUAGE: +MultiPlatformProjects
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
|
||||
expect open class A() {
|
||||
fun foo()
|
||||
}
|
||||
|
||||
open class B : A()
|
||||
|
||||
// MODULE: m1-jvm(m1-common)
|
||||
// FILE: jvm.kt
|
||||
|
||||
actual open class A {
|
||||
actual fun foo() {}
|
||||
|
||||
fun bar() {}
|
||||
}
|
||||
|
||||
class C : B() {
|
||||
fun test() {
|
||||
foo()
|
||||
bar()
|
||||
}
|
||||
}
|
||||
|
||||
class D : A() {
|
||||
fun test() {
|
||||
foo()
|
||||
bar()
|
||||
}
|
||||
}
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
FILE: common.kt
|
||||
public open expect class A : R|kotlin/Any| {
|
||||
public constructor(): R|A| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final fun foo(): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
public open class B : R|A| {
|
||||
public constructor(): R|B| {
|
||||
super<R|A|>()
|
||||
}
|
||||
|
||||
}
|
||||
FILE: jvm.kt
|
||||
public open actual class A : R|kotlin/Any| {
|
||||
public constructor(): R|A| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final actual fun foo(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
public final fun bar(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
public final class C : R|B| {
|
||||
public constructor(): R|C| {
|
||||
super<R|B|>()
|
||||
}
|
||||
|
||||
public final fun test(): R|kotlin/Unit| {
|
||||
this@R|/C|.R|/A.foo|()
|
||||
this@R|/C|.R|/A.bar|()
|
||||
}
|
||||
|
||||
}
|
||||
public final class D : R|A| {
|
||||
public constructor(): R|D| {
|
||||
super<R|A|>()
|
||||
}
|
||||
|
||||
public final fun test(): R|kotlin/Unit| {
|
||||
this@R|/D|.R|/A.foo|()
|
||||
this@R|/D|.R|/A.bar|()
|
||||
}
|
||||
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
// !LANGUAGE: +MultiPlatformProjects
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
|
||||
expect open class A() {
|
||||
fun foo()
|
||||
}
|
||||
|
||||
open class B : A()
|
||||
|
||||
// MODULE: m1-jvm(m1-common)
|
||||
// FILE: jvm.kt
|
||||
|
||||
abstract class X {
|
||||
fun bar() {}
|
||||
}
|
||||
|
||||
interface Y {
|
||||
fun baz() {}
|
||||
}
|
||||
|
||||
actual open class A : X(), Y {
|
||||
actual fun foo() {}
|
||||
}
|
||||
|
||||
class C : B() {
|
||||
fun test() {
|
||||
foo()
|
||||
bar()
|
||||
baz()
|
||||
}
|
||||
}
|
||||
|
||||
class D : A() {
|
||||
fun test() {
|
||||
foo()
|
||||
bar()
|
||||
baz()
|
||||
}
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
FILE: common.kt
|
||||
public open expect class A : R|kotlin/Any| {
|
||||
public constructor(): R|A| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final fun foo(): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
public open class B : R|A| {
|
||||
public constructor(): R|B| {
|
||||
super<R|A|>()
|
||||
}
|
||||
|
||||
}
|
||||
FILE: jvm.kt
|
||||
public abstract class X : R|kotlin/Any| {
|
||||
public constructor(): R|X| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final fun bar(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
public abstract interface Y : R|kotlin/Any| {
|
||||
public open fun baz(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
public open actual class A : R|X|, R|Y| {
|
||||
public constructor(): R|A| {
|
||||
super<R|X|>()
|
||||
}
|
||||
|
||||
public final actual fun foo(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
public final class C : R|B| {
|
||||
public constructor(): R|C| {
|
||||
super<R|B|>()
|
||||
}
|
||||
|
||||
public final fun test(): R|kotlin/Unit| {
|
||||
this@R|/C|.R|/A.foo|()
|
||||
this@R|/C|.R|/X.bar|()
|
||||
this@R|/C|.R|/Y.baz|()
|
||||
}
|
||||
|
||||
}
|
||||
public final class D : R|A| {
|
||||
public constructor(): R|D| {
|
||||
super<R|A|>()
|
||||
}
|
||||
|
||||
public final fun test(): R|kotlin/Unit| {
|
||||
this@R|/D|.R|/A.foo|()
|
||||
this@R|/D|.R|/X.bar|()
|
||||
this@R|/D|.R|/Y.baz|()
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user