Preserve sources properly for coroutine parts

Otherwise incremental reporting leads to exception when inlining into coroutine body happens
This commit is contained in:
Denis Zharkov
2016-05-30 14:35:54 +03:00
parent 7dda2d9f62
commit 07592398c1
8 changed files with 82 additions and 9 deletions
@@ -0,0 +1,24 @@
================ Step #1 =================
Cleaning output files:
out/production/module/META-INF/module.kotlin_module
out/production/module/inline/InlineKt.class
End of files
Compiling files:
src/inline.kt
End of files
Marked as dirty by Kotlin:
src/usage.kt
Exit code: ADDITIONAL_PASS_REQUIRED
------------------------------------------
Cleaning output files:
out/production/module/META-INF/module.kotlin_module
out/production/module/usage/Controller.class
out/production/module/usage/UsageKt$bar$1.class
out/production/module/usage/UsageKt.class
End of files
Compiling files:
src/usage.kt
End of files
Exit code: OK
------------------------------------------
@@ -0,0 +1,5 @@
package inline
inline fun f(x: Int): Int {
return x - 1
}
@@ -0,0 +1,5 @@
package inline
inline fun f(x: Int): Int {
return x + 1
}
@@ -0,0 +1,18 @@
package usage
fun async(coroutine x: Controller.() -> Continuation<Unit>) {
x(Controller()).resume(Unit)
}
class Controller {
suspend fun step(param: Int, next: Continuation<Int>) {
next.resume(param + 1)
}
}
fun bar() {
async {
val result = step(1)
inline.f(result)
}
}