JVM_IR: fix Result types in continuations & remove more codegen hacks
#KT-47129 Fixed
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
// WITH_RUNTIME
|
||||
import kotlin.coroutines.*
|
||||
|
||||
fun <T> runBlocking(c: suspend () -> T): T {
|
||||
var res: T? = null
|
||||
c.startCoroutine(Continuation(EmptyCoroutineContext) {
|
||||
res = it.getOrThrow()
|
||||
})
|
||||
return res!!
|
||||
}
|
||||
|
||||
fun box(): String = runBlocking { // Non-inline lambda;
|
||||
run { // In it an inline lambda
|
||||
val foo = { Result.success("OK") } // Unboxes Result.
|
||||
foo().getOrNull()!!
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user