Generate debug metadata for lambdas which capture crossinline lambdas
After cold stream related fixes, we do not generate state machine until the very last transformation of the lambda. Thus, it is safe to generate debug metadata for that lambda. #KT-30694 Fixed
This commit is contained in:
@@ -23,6 +23,10 @@ inline suspend fun <T : Any> Flow<T>.collect(crossinline action: suspend (T) ->
|
||||
override suspend fun emit(value: T) = action(value)
|
||||
})
|
||||
|
||||
inline suspend fun inlineMe(crossinline block: suspend () -> Unit) = suspend {
|
||||
block()
|
||||
}
|
||||
|
||||
// FILE: Test.kt
|
||||
|
||||
import flow.*
|
||||
@@ -45,5 +49,13 @@ fun box(): String {
|
||||
}
|
||||
}
|
||||
if ("(Test.kt:" !in str) return str
|
||||
builder {
|
||||
inlineMe {
|
||||
var continuation: Continuation<Unit>? = null
|
||||
suspendCoroutineUninterceptedOrReturn<Unit> { continuation = it; Unit }
|
||||
str = "$continuation"
|
||||
}()
|
||||
}
|
||||
if ("(Test.kt:" !in str) return str
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user