Show line markers for suspending iteration

#KT-16803 Fixed
This commit is contained in:
Dmitry Jemerov
2017-05-09 10:26:42 +02:00
parent baa43a2a55
commit c778e0454d
3 changed files with 40 additions and 9 deletions
@@ -0,0 +1,17 @@
fun coroutine(block: suspend () -> Unit) {}
class SIter {
operator fun iterator() = this
suspend operator fun hasNext(): Boolean = false
suspend operator fun next(): Int = 0
suspend fun test() {}
}
fun foo() {
val iter = SIter()
coroutine {
iter.<lineMarker descr="Suspend function call">test</lineMarker>() // this line is marked (LINE1)
for (x in <lineMarker descr="Suspending iteration">iter</lineMarker>) // this line is not (LINE2)
println(x)
}
}