Files
kotlin-fork/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInEndOfFun.kt
T
Yan Zhulanow 4244f05307 Debugger: Fix step over in functions with default parameters (KT-14828)
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.
2020-05-27 02:38:43 +09:00

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