Files
kotlin-fork/compiler/testData/cfg-variables/lexicalScopes/forScope.values
T
Denis Zharkov 02b40326cc Fix incorrect coroutines codegen behavior
If all the suspension calls in a suspend function were "hidden"
under the for-convention (iterator/next/hasNext) calls,
control-flow didn't find them, thus supposing that there is no
suspension points and there is no need to generate a coroutine state machine

The solution is to add relevant calls to CFG

 #KT-15824 Fixed
2017-01-25 13:54:01 +03:00

19 lines
981 B
Plaintext
Vendored

== foo ==
fun foo() {
"before"
for (i in 1..10) {
val a = i
}
"after"
}
---------------------
<v7>: Int NEW: magic[LOOP_RANGE_ITERATION](1..10|<v6>) -> <v7>
"before" <v0>: * NEW: r("before") -> <v0>
1 <v1>: Int NEW: r(1) -> <v1>
10 <v2>: Int NEW: r(10) -> <v2>
1..10 <v6>: {<: Iterable<Int>} NEW: call(1..10, next) -> <v6>
i <v8>: Int NEW: r(i) -> <v8>
"after" <v9>: * NEW: r("after") -> <v9>
{ "before" for (i in 1..10) { val a = i } "after" } <v9>: * COPY
=====================