ForLoopsLowering: Assume step == 1 for *Range (e.g., IntRange) and
handle accordingly (e.g., do not read `step` property).
This commit is contained in:
committed by
Alexander Udalov
parent
09e47fff7b
commit
2cfd776092
+4
-5
@@ -1,6 +1,6 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
fun box(): String {
|
||||
val intProgression = 1..7
|
||||
val intProgression = 1..7 step 3 // `step` ensures type is IntProgression, NOT IntRange
|
||||
for (i in intProgression step 2) {
|
||||
}
|
||||
|
||||
@@ -15,10 +15,9 @@ fun box(): String {
|
||||
// Expected lowered form of loop:
|
||||
//
|
||||
// // Additional statements:
|
||||
// val progression = intProgression
|
||||
// val nestedFirst = progression.first
|
||||
// val nestedLast = progression.last
|
||||
// val nestedStep = progression.step
|
||||
// val nestedFirst = intProgression.first
|
||||
// val nestedLast = intProgression.last
|
||||
// val nestedStep = intProgression.step
|
||||
// val maybeNegatedStep = if (nestedStep <= 0) -2 else 2
|
||||
//
|
||||
// // Standard form of loop over progression
|
||||
|
||||
Reference in New Issue
Block a user