Make breakpoints work in suspend functions
This commit is contained in:
+40
@@ -0,0 +1,40 @@
|
||||
package stopInInlinedLambdaInSuspendFunctionWithSuspendPointsInObjectLiteral
|
||||
|
||||
import forTests.builder
|
||||
|
||||
fun foo(a: Any) {}
|
||||
|
||||
suspend fun second() { }
|
||||
|
||||
interface Bar {
|
||||
suspend fun first()
|
||||
}
|
||||
|
||||
inline fun call(f: () -> Unit) {
|
||||
f()
|
||||
}
|
||||
|
||||
val bar = object : Bar {
|
||||
val t = 121
|
||||
|
||||
override suspend fun first() {
|
||||
foo("first")
|
||||
|
||||
call {
|
||||
{
|
||||
//Breakpoint!
|
||||
foo(t)
|
||||
}()
|
||||
}
|
||||
|
||||
second()
|
||||
|
||||
foo("second")
|
||||
}
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
builder {
|
||||
bar.first()
|
||||
}
|
||||
}
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
package stopInSuspendFunctionWithSuspendPoints
|
||||
|
||||
import forTests.builder
|
||||
|
||||
fun foo(a: Any) {}
|
||||
|
||||
suspend fun second() {
|
||||
}
|
||||
|
||||
suspend fun first() {
|
||||
foo("first")
|
||||
|
||||
second()
|
||||
|
||||
//Breakpoint!
|
||||
foo("second")
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
builder {
|
||||
first()
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package stopInSuspendFunctionWithSuspendPointsInAnonymousObject
|
||||
|
||||
import forTests.builder
|
||||
|
||||
fun foo(a: Any) {}
|
||||
|
||||
suspend fun second() { }
|
||||
|
||||
interface Bar {
|
||||
suspend fun first()
|
||||
}
|
||||
|
||||
val bar = object : Bar {
|
||||
override suspend fun first() {
|
||||
foo("first")
|
||||
|
||||
second()
|
||||
|
||||
//Breakpoint!
|
||||
foo("second")
|
||||
}
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
builder {
|
||||
bar.first()
|
||||
}
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package stopInSuspendFunctionWithSuspendPointsInObjectLiteralInInlineCallWithClosure
|
||||
|
||||
import forTests.builder
|
||||
|
||||
fun foo(a: Any) {}
|
||||
|
||||
suspend fun second() {
|
||||
foo("call")
|
||||
}
|
||||
|
||||
interface F {
|
||||
suspend fun test() {}
|
||||
}
|
||||
|
||||
inline fun call(f: () -> Unit) {
|
||||
f()
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val inClosure = "first"
|
||||
call {
|
||||
{
|
||||
val some = object : F {
|
||||
override suspend fun test() {
|
||||
foo(inClosure)
|
||||
second()
|
||||
//Breakpoint!
|
||||
foo("other")
|
||||
}
|
||||
}
|
||||
|
||||
builder {
|
||||
some.test()
|
||||
}
|
||||
}()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user