Functions imported from objects should be properly mapped to "real" suspend function descriptors.

This commit is contained in:
Dmitry Petrov
2017-01-25 16:50:06 +03:00
parent 9d4047f5e4
commit ab2448307e
7 changed files with 106 additions and 5 deletions
@@ -0,0 +1,34 @@
// WITH_RUNTIME
// WITH_COROUTINES
// FILE: stuff.kt
package stuff
import kotlin.coroutines.intrinsics.*
object Host {
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
x.resume("OK")
SUSPENDED_MARKER
}
}
// FILE: test.kt
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*
import stuff.Host.suspendHere
fun builder(c: suspend () -> Unit) {
c.startCoroutine(EmptyContinuation)
}
fun box(): String {
var result = ""
builder {
result = suspendHere()
}
return result
}