[JVM IR] Copy attributes for JVM_STATIC_WRAPPERS.

This commit is contained in:
Mads Ager
2021-05-10 15:57:31 +02:00
committed by Alexander Udalov
parent 3db5ba98ad
commit d397efb2bd
10 changed files with 62 additions and 20 deletions
@@ -0,0 +1,38 @@
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// WITH_COROUTINES
import helpers.*
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*
fun builder(c: suspend () -> Unit) {
c.startCoroutine(EmptyContinuation)
}
suspend fun <T> suspendHere(x: T): T = suspendCoroutineUninterceptedOrReturn {
it.resume(x)
COROUTINE_SUSPENDED
}
inline class I(val x: Any?)
open class C {
companion object {
@JvmStatic
protected suspend fun f(): I = I(suspendHere("OK"))
}
}
class D : C() {
companion object {
suspend fun g() = f()
}
}
fun box(): String {
var result = "FAIL"
builder {
result = D.g().x as String
}
return result
}