Minor. Merge multiplatformTypeRefinement testdata with multiplatform testdata
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
package sample
|
||||
|
||||
expect class A {
|
||||
fun commonFun()
|
||||
val x: Int
|
||||
val y: Double
|
||||
val z: String
|
||||
}
|
||||
|
||||
fun getCommonA(): A = null!!
|
||||
@@ -0,0 +1,7 @@
|
||||
MODULE common { platform=[JVM, JS, Native]; root=common }
|
||||
MODULE jvm { platform=[JVM]; root=jvm }
|
||||
MODULE main { platform=[JVM]; root=main }
|
||||
|
||||
jvm -> common { kind=DEPENDS_ON }
|
||||
jvm -> STDLIB_JVM { kind=DEPENDENCY }
|
||||
main -> jvm, common { kind=DEPENDENCY }
|
||||
@@ -0,0 +1,14 @@
|
||||
@file:Suppress("UNUSED_PARAMETER")
|
||||
|
||||
package sample
|
||||
|
||||
actual data class A(actual val x: Int, actual val y: Double, val t: String) {
|
||||
actual fun commonFun() {}
|
||||
fun platformFun() {}
|
||||
|
||||
actual val z: String by lazy { "" }
|
||||
|
||||
operator fun iterator(): Iterator<Int> = null!!
|
||||
}
|
||||
|
||||
fun testDelegate(): String = getCommonA().z
|
||||
@@ -0,0 +1,20 @@
|
||||
@file:Suppress("UNUSED_VARIABLE")
|
||||
|
||||
package sample
|
||||
|
||||
fun testDesctructing() {
|
||||
val (x, y, t) = getCommonA()
|
||||
val xx: Int = x
|
||||
val yy: Double = y
|
||||
val tt: String = t
|
||||
}
|
||||
|
||||
fun testIterator(): Int {
|
||||
var counter: Int = 0
|
||||
for (x in getCommonA()) {
|
||||
counter += x
|
||||
}
|
||||
return counter
|
||||
}
|
||||
|
||||
fun testDelegate(): String = getCommonA().z
|
||||
Reference in New Issue
Block a user