4244f05307
Adds a synthetic line number just before the original function call. The new line number is recognized by the debugger which replaces the 'step over' action with 'step into' and stops.
42 lines
708 B
Kotlin
Vendored
42 lines
708 B
Kotlin
Vendored
// ATTACH_LIBRARY: coroutines
|
|
|
|
package soSuspendableCallInEndOfFun
|
|
|
|
import forTests.WaitFinish
|
|
import forTests.builder
|
|
import kotlin.coroutines.Continuation
|
|
import kotlin.coroutines.*
|
|
|
|
private fun foo(a: Any) {}
|
|
|
|
val waiter = WaitFinish()
|
|
val suspendWaiter = WaitFinish()
|
|
|
|
fun main(args: Array<String>) {
|
|
builder {
|
|
inFun()
|
|
}
|
|
|
|
suspendWaiter.finish()
|
|
|
|
foo("Main end")
|
|
waiter.waitEnd()
|
|
}
|
|
|
|
suspend fun inFun() {
|
|
foo("Start")
|
|
//Breakpoint!
|
|
run()
|
|
}
|
|
|
|
suspend fun run() {
|
|
suspendCoroutine { cont: Continuation<Unit> ->
|
|
Thread {
|
|
suspendWaiter.waitEnd()
|
|
cont.resume(Unit)
|
|
waiter.finish()
|
|
}.start()
|
|
}
|
|
}
|
|
|
|
// STEP_OVER: 3 |