Implement basic support for coroutines in JVM backend

This commit is contained in:
Denis Zharkov
2016-05-25 14:46:38 +03:00
parent 077fc528d1
commit 75e112e752
30 changed files with 1151 additions and 45 deletions
@@ -0,0 +1,24 @@
// FILE: A.kt
package a
class Controller {
suspend fun suspendHere(x: Continuation<String>) {
x.resume("OK")
}
}
fun builder(coroutine c: Controller.() -> Continuation<Unit>) {
c(Controller()).resume(Unit)
}
// FILE: B.kt
import a.builder
fun box(): String {
var result = ""
builder {
result = suspendHere()
}
return result
}