Ignore unreachable code on tail call optimization

#KT-21759: Fixed
This commit is contained in:
Ilmir Usmanov
2018-01-12 19:04:42 +03:00
parent 25998c1f9b
commit ed11528664
10 changed files with 299 additions and 3 deletions
@@ -0,0 +1,24 @@
// WITH_RUNTIME
// WITH_COROUTINES
import helpers.*
import kotlin.coroutines.experimental.*
import kotlin.coroutines.experimental.intrinsics.*
suspend fun twoReturns(c: suspend () -> Unit) {
return c()
throw RuntimeException("FAIL 1")
}
fun builder(c: suspend () -> Unit) {
c.startCoroutine(EmptyContinuation)
}
fun box(): String {
var res = "FAIL"
builder {
twoReturns {
res = "OK"
}
}
return res
}