Remove returns unit markers in suspend lambdas

This commit is contained in:
Ilmir Usmanov
2018-01-24 21:43:59 +03:00
parent e169383f76
commit e6a353e590
4 changed files with 39 additions and 2 deletions
@@ -0,0 +1,29 @@
// WITH_RUNTIME
// WITH_COROUTINES
import helpers.*
import kotlin.coroutines.experimental.*
import kotlin.coroutines.experimental.intrinsics.*
// TREAT_AS_ONE_FILE
var res = "FAIL"
suspend fun suspendHere() = suspendCoroutineOrReturn<Unit> {
res = "OK"
it.resume(Unit)
COROUTINE_SUSPENDED
}
fun builder(c: suspend () -> Unit) {
c.startCoroutine(EmptyContinuation)
}
fun box() : String {
builder {
suspendHere()
}
return res
}
// 0 ICONST_2
// 0 ICONST_3