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

array: fix multiple array.repeat index error

This commit is contained in:
yuyi
2020-06-12 17:42:26 +08:00
committed by GitHub
parent 827a9e221f
commit b4ad174b7f
2 changed files with 12 additions and 1 deletions

View File

@@ -821,4 +821,8 @@ fn test_mutli_array_index() {
mut a := [][]int{len:2, init: []int{len:3, init:0}}
a[0][0] = 1
assert '$a' == '[[1, 0, 0], [0, 0, 0]]'
mut b := [[0].repeat(3)].repeat(2)
b[0][0] = 1
assert '$b' == '[[1, 0, 0], [0, 0, 0]]'
}