Check that breakpoints work in suspend function without suspension points
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package forTests
|
||||
|
||||
import kotlin.coroutines.Continuation
|
||||
import kotlin.coroutines.CoroutineContext
|
||||
import kotlin.coroutines.EmptyCoroutineContext
|
||||
import kotlin.coroutines.startCoroutine
|
||||
|
||||
open class EmptyContinuation(override val context: CoroutineContext = EmptyCoroutineContext) : Continuation<Any?> {
|
||||
companion object : EmptyContinuation()
|
||||
override fun resume(data: Any?) {}
|
||||
override fun resumeWithException(exception: Throwable) { throw exception }
|
||||
}
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
package stopInSuspendFunctionWithoutSuspendPoints
|
||||
|
||||
import forTests.builder
|
||||
|
||||
fun foo(a: Any) {}
|
||||
|
||||
suspend fun first() {
|
||||
foo("first")
|
||||
|
||||
//Breakpoint!
|
||||
foo("second")
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
builder {
|
||||
first()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user