Fix coroutine generation in case of empty lambda
'handleResult' should be called in such case too
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
class Controller {
|
||||
var ok = false
|
||||
|
||||
operator fun handleResult(u: Unit, v: Continuation<Nothing>) {
|
||||
ok = true
|
||||
}
|
||||
}
|
||||
|
||||
fun builder(coroutine c: Controller.() -> Continuation<Unit>): String {
|
||||
val controller = Controller()
|
||||
c(controller).resume(Unit)
|
||||
if (!controller.ok) throw java.lang.RuntimeException("Was not called")
|
||||
return "OK"
|
||||
}
|
||||
|
||||
fun unitFun() {}
|
||||
|
||||
fun box(): String {
|
||||
return builder {}
|
||||
}
|
||||
Reference in New Issue
Block a user