02b40326cc
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
42 lines
3.3 KiB
Plaintext
Vendored
42 lines
3.3 KiB
Plaintext
Vendored
== foo ==
|
|
fun foo(numbers: Collection<Int>) {
|
|
for (i in numbers) {
|
|
val b: Boolean
|
|
if (1 < 2) {
|
|
b = false
|
|
}
|
|
else {
|
|
b = true
|
|
}
|
|
use(b)
|
|
continue
|
|
}
|
|
}
|
|
---------------------
|
|
<v0>: {<: Collection<Int>} NEW: magic[FAKE_INITIALIZER](numbers: Collection<Int>) -> <v0>
|
|
<v5>: Int NEW: magic[LOOP_RANGE_ITERATION](numbers|<v4>) -> <v5>
|
|
numbers <v4>: {<: Iterable<Int>} NEW: call(numbers, next) -> <v4>
|
|
1 <v6>: {<: Comparable<Int>} NEW: r(1) -> <v6>
|
|
2 <v7>: Int NEW: r(2) -> <v7>
|
|
1 < 2 <v8>: Boolean NEW: call(1 < 2, compareTo|<v6>, <v7>) -> <v8>
|
|
false <v9>: Boolean NEW: r(false) -> <v9>
|
|
b = false !<v10>: *
|
|
{ b = false } !<v10>: * COPY
|
|
true <v11>: Boolean NEW: r(true) -> <v11>
|
|
b = true !<v12>: *
|
|
{ b = true } !<v12>: * COPY
|
|
if (1 < 2) { b = false } else { b = true } <v13>: * NEW: merge(if (1 < 2) { b = false } else { b = true }|!<v10>, !<v12>) -> <v13>
|
|
b <v14>: * NEW: r(b) -> <v14>
|
|
use(b) <v15>: * NEW: call(use(b), use|<v14>) -> <v15>
|
|
continue !<v16>: *
|
|
{ val b: Boolean if (1 < 2) { b = false } else { b = true } use(b) continue } !<v16>: * COPY
|
|
for (i in numbers) { val b: Boolean if (1 < 2) { b = false } else { b = true } use(b) continue } !<v17>: *
|
|
{ for (i in numbers) { val b: Boolean if (1 < 2) { b = false } else { b = true } use(b) continue } } !<v17>: * COPY
|
|
=====================
|
|
== use ==
|
|
fun use(vararg a: Any?) = a
|
|
---------------------
|
|
<v0>: {<: Array<out Any?>} NEW: magic[FAKE_INITIALIZER](vararg a: Any?) -> <v0>
|
|
a <v1>: {<: Array<out Any?>} NEW: r(a) -> <v1>
|
|
=====================
|