Adapt FixStackAnalyzer to code generated by coroutine transformation
Without this change internal error happens while inlining coroutine code with try/catch inside Also get rid of hack with SKIP_MANDATORY_TRANSFORMATIONS_ANNOTATION_DESC See comment within MethodAnalyzer for clarification
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
|
||||
class Controller {
|
||||
suspend fun suspendHere(v: String, x: Continuation<String>) {
|
||||
x.resume(v)
|
||||
}
|
||||
}
|
||||
|
||||
fun builder(coroutine c: Controller.() -> Continuation<Unit>) {
|
||||
c(Controller()).resume(Unit)
|
||||
}
|
||||
|
||||
inline fun run(block: () -> Unit) {
|
||||
block()
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var result = ""
|
||||
run {
|
||||
builder {
|
||||
try {
|
||||
result += suspendHere("O")
|
||||
} finally {
|
||||
result += suspendHere("K")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
Reference in New Issue
Block a user