mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
If an upper bound is a compile-time constant != Int.MAX_VALUE, we can generate 'for (i in x..N)' as 'for (i in x until N+1)'.
12 lines
146 B
Kotlin
Vendored
12 lines
146 B
Kotlin
Vendored
const val N = 42
|
|
|
|
fun test(): Int {
|
|
var sum = 0
|
|
for (i in 1 .. N) {
|
|
sum += i
|
|
}
|
|
return sum
|
|
}
|
|
|
|
// 0 IF_ICMPEQ
|
|
// 1 IF_ICMPGE |