Files
kotlin-fork/js/js.translator/testData/lineNumbers/for.kt
T
Alexey Andreev ca63717124 Multiple fixes of JS source maps
- elvis expression with complex RHS
- destructuring declarations
- decomposition of `var` statement (for example, in case of
  inline destructuring functions)
- `is` LHS &&/|| inline fun RHS
- argument assignment to temporary var on inline call site
- assignment of `next()` result to temporary var in `for` expression
- rethrow statement in exception handler
2017-07-06 10:20:49 +03:00

20 lines
387 B
Kotlin
Vendored

fun box() {
for (x in arrayOf(1, 2, 3)) {
println(x)
}
for (x in 1..10) {
println(x)
}
for (x in listOf(1, 2, 3)) {
println(x)
}
val xs = listOf(1, 2, 3)
for (x in xs.indices) {
println(x)
}
}
// LINES: 18 2 2 10 15 2 2 2 2 2 2 3 3 6 6 6 6 7 7 10 10 10 10 10 10 11 11 14 14 15 15 15 15 15 15 15 15 15 15 15 15 16 16