Handle withIndex() on Iterables (including progressions) and Sequences

in ForLoopsLowering.
This commit is contained in:
Mark Punzalan
2019-11-05 11:15:33 -08:00
committed by max-kammerer
parent a54d9482dd
commit 7adffe0007
49 changed files with 1357 additions and 42 deletions
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
val xs = listOf<Any>().asSequence()
fun box(): String {
@@ -15,3 +14,6 @@ fun box(): String {
// 1 next
// 0 component1
// 0 component2
// The 1st ICONST_0 is for initializing the list. 2nd is for initializing the index in the lowered for-loop.
// 2 ICONST_0
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
val xs = listOf("a", "b", "c", "d").asSequence()
fun box(): String {
@@ -18,3 +17,6 @@ fun box(): String {
// 1 next
// 0 component1
// 0 component2
// The 1st ICONST_0 is for initializing the list. 2nd is for initializing the index in the lowered for-loop.
// 2 ICONST_0
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
val xs = listOf("a", "b", "c", "d").asSequence()
fun box(): String {
@@ -18,3 +17,6 @@ fun box(): String {
// 1 next
// 0 component1
// 0 component2
// The 1st ICONST_0 is for initializing the list. 2nd is for initializing the index in the lowered for-loop.
// 2 ICONST_0
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
val xs = listOf("a", "b", "c", "d").asSequence()
fun box(): String {
@@ -18,3 +17,6 @@ fun box(): String {
// 1 next
// 0 component1
// 0 component2
// The 1st ICONST_0 is for initializing the list. 2nd is for initializing the index in the lowered for-loop.
// 2 ICONST_0
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// FULL_JDK
val xsl = arrayListOf("a", "b", "c", "d")
@@ -29,3 +28,6 @@ fun box(): String {
// 1 next
// 0 component1
// 0 component2
// The 1st ICONST_0 is for initializing the list. 2nd is for cmeThrown. 3rd is for initializing the index in the lowered for-loop.
// 3 ICONST_0
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
val xs = listOf("a", "b", "c", "d").asSequence()
fun useAny(x: Any) {}
@@ -21,3 +20,6 @@ fun box(): String {
// 1 next
// 0 component1
// 0 component2
// The 1st ICONST_0 is for initializing the list. 2nd is for initializing the index in the lowered for-loop.
// 2 ICONST_0