Minor. Merge multiplatformTypeRefinement testdata with multiplatform testdata
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
@file:Suppress("UNUSED_PARAMETER")
|
||||
package sample
|
||||
|
||||
interface AA
|
||||
interface BB
|
||||
interface CC
|
||||
interface DD
|
||||
|
||||
expect interface A {
|
||||
fun foo_A()
|
||||
}
|
||||
|
||||
fun take0(x: A): AA = null!!
|
||||
fun take1(x: A): AA = null!!
|
||||
fun take2(x: A): AA = null!!
|
||||
fun take3(x: A): AA = null!!
|
||||
fun take4(x: A): AA = null!!
|
||||
|
||||
fun test(x: A) {
|
||||
take4(x)
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
@file:Suppress("UNUSED_PARAMETER")
|
||||
package sample
|
||||
|
||||
expect interface B : A {
|
||||
fun foo_B_1()
|
||||
}
|
||||
|
||||
fun take1(x: B): BB = null!!
|
||||
fun take2(x: B): BB = null!!
|
||||
fun take3(x: B): BB = null!!
|
||||
|
||||
fun getB(): B = null!!
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
@file:Suppress("UNUSED_PARAMETER")
|
||||
package sample
|
||||
|
||||
expect interface C : A {
|
||||
fun foo_C_1()
|
||||
}
|
||||
|
||||
fun take1(x: C): CC = null!!
|
||||
|
||||
fun getC(): C = null!!
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
@file:Suppress("UNUSED_PARAMETER")
|
||||
package sample
|
||||
|
||||
actual interface A {
|
||||
actual fun foo_A()
|
||||
fun foo_A_3()
|
||||
}
|
||||
|
||||
fun take0(x: A): DD = null!!
|
||||
fun take1(x: A): DD = null!!
|
||||
fun take2(x: A): DD = null!!
|
||||
fun take4(x: A): DD = null!!
|
||||
|
||||
fun test(x: A) {
|
||||
<!OVERLOAD_RESOLUTION_AMBIGUITY(" public fun take4(x: A): AA defined in sample in file common-1.kt public fun take4(x: A): DD defined in sample in file common-2-3.kt")!>take4<!>(x)
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
MODULE common-1 { platform=[JVM, JS, Native] }
|
||||
|
||||
MODULE common-2-1 { platform=[JVM, JS, Native] }
|
||||
MODULE common-2-2 { platform=[JVM, JS, Native] }
|
||||
MODULE common-2-3 { platform=[JVM, JS, Native] }
|
||||
|
||||
MODULE jvm { platform=[JVM] }
|
||||
|
||||
common-2-1 -> common-1 { kind=DEPENDS_ON }
|
||||
common-2-2 -> common-1 { kind=DEPENDS_ON }
|
||||
common-2-3 -> common-1 { kind=DEPENDS_ON }
|
||||
|
||||
jvm -> common-2-1, common-2-2 { kind=DEPENDS_ON }
|
||||
jvm -> common-2-3 { kind=DEPENDS_ON }
|
||||
|
||||
jvm -> common-1 { kind=DEPENDS_ON }
|
||||
@@ -0,0 +1,25 @@
|
||||
This file presents modules dependency graph for the test (classes).
|
||||
Please, use monospaced font.
|
||||
|
||||
common-1-1
|
||||
/ | \
|
||||
/ | \
|
||||
/ | \
|
||||
/ | \
|
||||
/ | \
|
||||
/ | \
|
||||
/ | \
|
||||
/ | \
|
||||
/ | \
|
||||
common-2-1 common-2-2 common-2-2
|
||||
\ | /
|
||||
\ | /
|
||||
\ | /
|
||||
\ | /
|
||||
\ | /
|
||||
\ | /
|
||||
\ | /
|
||||
\ | /
|
||||
\ | /
|
||||
\ | /
|
||||
jvm
|
||||
@@ -0,0 +1,45 @@
|
||||
@file:Suppress("UNUSED_PARAMETER", "UNUSED_VARIABLE")
|
||||
package sample
|
||||
|
||||
interface D : A {
|
||||
fun foo_B_1()
|
||||
fun foo_B_2()
|
||||
fun foo_C_1()
|
||||
fun foo_C_2()
|
||||
fun foo_D()
|
||||
}
|
||||
|
||||
actual typealias B = D
|
||||
actual typealias C = D
|
||||
|
||||
fun take0(x: D): Unit = null!!
|
||||
|
||||
fun test_1(x: D) {
|
||||
val res0: Unit = take0(x)
|
||||
<!OVERLOAD_RESOLUTION_AMBIGUITY(" public fun take1(x: A): AA defined in sample in file common-1.kt public fun take1(x: A): DD defined in sample in file common-2-3.kt public fun take1(x: B): BB defined in sample in file common-2-1.kt public fun take1(x: C): CC defined in sample in file common-2-2.kt")!>take1<!>(x)
|
||||
val res2: BB = take2(x)
|
||||
val res3: BB = take3(x)
|
||||
<!OVERLOAD_RESOLUTION_AMBIGUITY(" public fun take4(x: A): AA defined in sample in file common-1.kt public fun take4(x: A): DD defined in sample in file common-2-3.kt")!>take4<!>(x)
|
||||
}
|
||||
|
||||
fun test_2() {
|
||||
val x = getB()
|
||||
x.foo_A()
|
||||
x.foo_A_3()
|
||||
x.foo_B_1()
|
||||
x.foo_B_2()
|
||||
x.foo_C_1()
|
||||
x.foo_C_2()
|
||||
x.foo_D()
|
||||
}
|
||||
|
||||
fun test_3() {
|
||||
val x = getB()
|
||||
x.foo_A()
|
||||
x.foo_A_3()
|
||||
x.foo_B_1()
|
||||
x.foo_B_2()
|
||||
x.foo_C_1()
|
||||
x.foo_C_2()
|
||||
x.foo_D()
|
||||
}
|
||||
Reference in New Issue
Block a user