1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

all: rename it to index in array inits (#17543)

This commit is contained in:
ChAoS_UnItY
2023-03-09 03:51:45 +08:00
committed by GitHub
parent 2597efa7f6
commit ae6a48c0e3
17 changed files with 75 additions and 62 deletions

View File

@@ -1598,12 +1598,12 @@ fn f(x int, y int) []int {
}
fn test_2d_array_init_with_it() {
a := [][]int{len: 6, init: f(it, 2 * it)}
a := [][]int{len: 6, init: f(index, 2 * index)}
assert a == [[0, 0], [1, 2], [2, 4], [3, 6], [4, 8], [5, 10]]
}
fn test_using_array_name_variable() {
array := []int{len: 4, init: it}
array := []int{len: 4, init: index}
println(array)
assert array == [0, 1, 2, 3]
}