Add regression test for KT-20744

#KT-20744: Obsolete
This commit is contained in:
Ilmir Usmanov
2018-03-16 21:56:24 +03:00
parent 2d4ef8d1e6
commit 7b2de2de5e
5 changed files with 51 additions and 0 deletions
@@ -0,0 +1,27 @@
// WITH_RUNTIME
// WITH_COROUTINES
import helpers.*
import kotlin.coroutines.experimental.*
import kotlin.properties.Delegates
class Pipe {
var value = 0
suspend fun send(value: Int) {
this.value = value
}
}
fun builder(c: suspend () -> Unit) {
c.startCoroutine(EmptyContinuation)
}
val pipe = Pipe()
var mode by Delegates.observable(0) {_, _, value -> builder { pipe.send(value) }}
fun box() : String {
mode = 42
if (pipe.value != 42) return "FAIL"
return "OK"
}