JVM_IR: Minor. Add test

This commit is contained in:
Ilmir Usmanov
2020-02-04 20:59:49 +01:00
parent 5977799c59
commit 8335ad7e98
7 changed files with 57 additions and 0 deletions
@@ -0,0 +1,27 @@
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
// WITH_COROUTINES
import helpers.*
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*
fun <T> builder(value: T, c: suspend T.() -> Unit) {
c.startCoroutine(value, EmptyContinuation)
}
interface A<T> {
val value: T
var result: T
fun test(): T {
builder(value) { result = this }
return result
}
}
fun box(): String =
object : A<String> {
override val value = "OK"
override var result = "Fail"
}.test()