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:
Denis Zharkov
2016-06-03 16:11:28 +03:00
parent 678e8c2baa
commit 0d01edb7f9
5 changed files with 41 additions and 9 deletions
@@ -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
}